One would think that to a question this common, the answer shouldn’t be so hard to find. Of course, the Bible contains many different books, written at different times by different people. This means that sometimes there isn’t a straightforward answer to the question.
It’s hardest part of the answer is around the Old Testament books. While there's too much to pack in here about the authorship of the earliest books of the OT, the oldest written ones date probably between 800 BCE - 600 BCE. Certainly during the Babylonian Exile, much of the oral tradition began to be written down. The latest books of the OT end somewhere around 500 BCE. There are several books that we classify as "apocryphal" that date up to around 100 BCE (Maccabees).
It’s easier to answer for the New Testament books. These were written within a much shorter timespan, more or less in the years between 45 CE and 95 CE. While none of the books contains a specific date of composition, scholars have managed to assign dates that are fairly accurate. The Book of James is regarded as the oldest in the NT. The letters written by Paul to various church communities make up the bulk of the early writings beginning around the early 50s. The "newest" book of the NT is generally thought to be Revelation written around 95 CE.