Q. Do we know who wrote the book of Job? Or when it was written?
A. The short answer is: we don't know. Ancient scribes didn't usually sign writings in the ancient world. Unlike today, ancient people didn't listen to a story and think: "I wonder who wrote that?" They didn't care about that question mainly because all the best stories had already been passed down for many generations by the time they were considered good stories.
In the book of Ezekiel, we hear a short version of the Job story where Job saves his children through his faithfulness (Ezek 14:14, Ezek 14:20), which does not seem to correspond to the biblical book of Job. We also see a lively ancient tradition about a Job-figure who is always patient and never erupts in anger at God, as he does throughout the biblical version (see the Testament of Job and perhaps Jas 5:11, and compare to Job 9). This suggests that there were many stories about Job in the ancient world, and what we find in the Bible is only one of them.
But we do know some things about how the biblical book was written. Scholars are fairly confident that several hands, at least, are responsible for the book of Job. The striking differences in both genre and attitude between the prose prologue and epilogue (Job 1:1-2:11; Job 42:7-17) and the poetic discourses in the middle of the book (Job 3:1-42:6) suggest that an earlier version of a folktale was expanded with the dialogues. Some scholars point to seemingly different features of the Elihu speeches (Job 32-37) to argue that he was a later addition to the poetic discourses. And later still, the Jewish scribes responsible for the Old Greek version of the scriptures trimmed down the poetic section, particularly in the last third of the discourses, likely to make the book more palatable to changing literary tastes.
So, when did these compositions and editorial activities occur? Some scholars have argued for an early date around the 10th century B.C.E., because of its seemingly archaic diction and references to older forms of currency (Job 42:11). But other scholars, including Edward Greenstein, have demonstrated that the language is not actually archaic—it merely looks archaic in order to give the flavor of antiquity. Similarly, in the book of Job, the words sound vaguely Transjordanian, which signals its setting in a faraway land in an ancient time.
Based on resonances with Second Isaiah (for example, Job 9:8, Isa 44:24), Lamentations (Job 19:7-8, Lam 3:7-9), and Jeremiah (Job 3:3, Job 3:10-11, Jer 20:14-18), which are all exilic texts, one can imagine that the biblical text of Job developed from traditional materials during the period of the Exile. This makes sense contextually, because the themes of Job and the bitterness of the poetic dialogues would have resonated with readers of that time. Moreover, the reference to raiding Chaldeans in the Transjordan (Job 1:15-17) would make sense only during the relatively brief period of the Neo-Babylonian Empire. This would place the poetic dialogues somewhere in the sixth or fifth centuries B.C.E., produced by scribes attempting to explore the theological and ethical ramifications of the experience of exile and the destruction of Solomon's Temple in Jerusalem. Possible editing and further compositional work, including Elihu's speeches, would have a fourth-to-third century date. The book also appears in the Dead Sea Scrolls, so the latest date of compositional work in the proto-Masoretic version would be 200 B.C.E.