Who wrote/compiled/edited the various histories in the Old Testament such as Judges, Kings, etc. and when?
The books of the Old Testament can be classified as three types: histories, prophecies, and wisdom literature.

Following the exodus from Egypt and the years of wandering in the desert, Joshua assumed leadership from Moses (around 1200 BC) and began the conquest of the land of Canaan. The story of that conquest is told in the Book of Joshua, including the famous story of the walls of Jericho plus other military exploits. According to religious tradition, the book was written mostly by Joshua himself, with a few verses (such as the death of Joshua) added by contemporaries.

The time of Joshua was followed by a period of 200 to 300 years during which the Israelites were a loose confederation of twelve tribes, each occupying its own territory. There was no central leadership, but from time to time a Judge arose to help one or more tribes face a common enemy. The Judges were heroes, such as Deborah, Samson and Gideon and the book of Judges told their story. Tradition holds that this book was written mostly by Samuel, the last Judge, around 1000 BC.

The Israelites clamored for a king, and the last judge, Samuel, appointed Saul as first king over all twelve tribes. Saul was a failure as king, and was succeeded by David, the shepherd boy who killed the giant Goliath, was persecuted by Saul, and finally won the kingship and established a dynastic line around 1000 BC. Tradition ascribes the authorship of most of the first part of the book to Samuel himself.

Solomon succeeded David as king. Following the death of Solomon (around 920 BC), the kingdom split in two, Israel in the north and Judah in the south. Although the two nations had common background and tradition, they had very different politics, and different prophets arose in each country. The two books of Kings tell the stories of the succession of kings in both kingdoms, more or less in chronological order. In 722 BC, Assyria overran and destroyed the northern kingdom of Israel, and that line of kings ended. In 586 BC, the Babylonians overran the southern kingdom of Judah, destroyed the Temple and burned Jerusalem, taking what remained of Judaism into captivity in Babylon (the Exile). The Book of Kings ends with the Babylonian exile, so the final chapters, at least, were written just after 586 BC. This book is ascribed to the prophet Jeremiah.

Ezra and Nehemiah
Fifty years after the Babylonian exile, by 538 BC, the Persians under Cyrus overran the Babylonian Empire and the Jews were allowed to return to Jerusalem. The exiles returned in several waves. From about 521 to 485 BC, the time of the prophets Haggai and Zechariah, the second Temple was built. Around 450 BC (the dates are uncertain, perhaps as early as 460 BC, perhaps as late as 398 BC), Ezra the scribe and Nehemiah the governor re-established centralized Judaism in Jerusalem. The books of Ezra and Nehemiah tell the story of that era of regeneration and rebirth. "Miraculous" is not too strong a word--no other people, in all of history, has been re-established and reborn after conquest and exile.

Originally, Ezra and Nehemiah was a single book, and ancient Hebrew and Greek manuscripts treat them as such. They're still only one book in the Hebrew Bible. The book was split in two by Jerome, at the end of 4th century AD, and appears as two books in the Catholic and Protestant bibles. Authorship is generally attributed to Ezra, who was a scribe and a priest, and to Nehemiah.

Chronicles tells the story of Israel from the earliest days through the Babylonian Exile in 586 BC. Of main importance is the history of the kings, from David (1000 BC) onward. In the Christian Bible, Chronicles is two books; in the Hebrew Bible, it is only one.

The story of Ruth is set during the era of the Judges, around 1100 BC (three generations before David.) Tradition says the text was written by Samuel around 1050 BC.

The story is set during the reign of a King of Persia called Ahasuerus (Xerxes in Greek). The description of the personality of Xerxes I (486 - 465 BC) given by Herodotus (vain, dumb, etc.) coincides pretty well with the personality of Ahasuerus in the text. The story is set at the king's winter palace in Susa, the remains of which, interestingly enough, have been excavated. Authorship probably dates from the late Persian period around 350 BC, when the recollection of Xerxes and his reign had faded, and when the Jews were subject to persecution for their refusal to be assimilated. Tradition says Esther was written by Mordecai, who is featured in it.

Written by The Straight Dope Staff Members Dex and Eutychus.