The story is set in the land of Uz, which, it should be noted, is not part of Israel. You could guess that this officially classifies Job as a non-Israelite (a pretty shocking characteristic for a hero in the Hebrew Bible). But the story sets itself in the patriarchal age, way back before Moses and Joshua led their people into the land God promised them; i.e., before Israel was really a thing.
So it's not necessarily a strike against him, in the writer's eyes, that he's an Uzzian (we're sure that's what they were called.) Plus, Uz (a poetic name for a land called Edom) had a reputation among Biblical authors as being a legendary home of wisdom (see 1 Kings 5:10). So, in a nutshell, Job is a product of a slightly different world than his Israelite audience inhabited, living in the wise old land of yore.
In terms of micro-setting, most of our poetic dialogue happens in Job's burned out house, where he sits "among the ashes" and speaks to his friends (1:8). The whole scene is so bleak that Job's friends "did not recognize him" "when they saw him from a distance" (2:12). Depressing, we know.
If you were directing Job as a play, you'd only need one minimalistic set. In many Bible stories, setting is hugely important, but Job is a much more philosophical text. The focus is on one man and his relationship with God.
When, oh When?
Heads up, Shmoopers. There is some major disagreement about when Job was written down, and it's kind of a firestorm in the academic community. But don't worry, we're here to help.
First, it's important to remember that dating any Biblical text is very difficult. When Harry Potter came out, it came out. The text was finished, edited, and published in its current form. But in the ancient world, there were no publishing houses, most people couldn't read, and literacy was confined to kingly courts. That makes dating these things pretty tough.
Even if we could date a biblical text, all that would tell us is when the story was written down—not when it emerged on the cultural scene. That means a story like Job could have been around in different forms (told by different storytellers in different cultures) for millennia before somebody decided to write it down. And even once it was written down, somebody may have picked that document up, hummed "She'll Be Comin' 'Round the Mountain When She Comes" to themselves, and changed whatever they wanted. So we're talking multiple layers of changes, additions, and alterations, all of which work in service to the political motivations of whoever was writing at the time. Confused yet? So are we.
That said, in terms of Job, we have to consider the differences between the prose frame story and the poetic middle section. Let's start with the frame story.
The reference to some sort of divine court and the "sons of God" smacks of a monotheism that isn't all the way developed just yet, which might suggest a pre-exilic date (after the tragedy of the exile to Babylon in 586 BCE, the Israelites really hunkered down and tried to stop cheating on God with other gods, thinking that their disloyalty led to the exile). Thanks to this, some old potential parallels in Ancient Near Eastern literature, and the folk-taley feel of the text, scholars feel pretty comfy putting the frame-story in the pre-exilic period, or, at the very least, before the poetic section.
Meanwhile, the poetic section seems to give a shout out to some pretty serious theological critiques, in the context of a strict monotheism (no divine court in the dialogue). And we know from studying the rest of the Hebrew Bible that these two factors almost always flag post-exilic literature. After the exile, the Israelites simultaneously strengthened their monotheism (no more cheating), and started lobbing some serious gut-wrenching questions God's way (one upside of monotheism is you only have one door to knock on, after all). The big one: why do bad things (the exile) happen to good people (the chosen Israelites)? Not easy to answer.
There's more evidence that you don't need to worry about (linguistic blah de blah and some literary dependency something or other), but here's the nutshell: the prose frame story is probably pre-exilic and was composed before 586 BCE, and the poetic dialogue is likely post-exilic (general consensus is 6th century, but it's a hot topic). The poetic author likely used the widely-known prose frame-story to pose the question, then composed his poetic epic to provide an answer.
If there is an answer at all...