The book doesn't give a date
Unlike some prophetic books, 1 Samuel does not open by naming its writer or telling us when it was completed. So no one can give a precise year from Scripture alone. That is worth saying plainly.
The book tells the story of Israel's move from the judges to kingship. It follows Samuel's ministry, Saul's troubled reign, and David's rise while Saul is still king. Those events belong roughly to the eleventh century BC, but the time of the events is not necessarily the date the book reached its final form.
Samuel was one source, not the whole answer
A later biblical passage says that Samuel recorded matters concerning King David, and that Nathan and Gad also recorded accounts of David's reign (1 Chronicles 29:29). This gives good reason to think the history behind 1 Samuel was preserved by people close to its events.
Yet Samuel could not have written every part of 1 Samuel himself. The book records his death and then continues with David's life, his escape from Saul, and his dealings with Abigail and the Philistines (1 Samuel 25:1). Scripture points to several prophetic records rather than asking us to imagine a single writer working alone.
Now the acts of David the king, first and last, behold, they are written in the book of Samuel the seer, and in the book of Nathan the prophet, and in the book of Gad the seer,
Clues suggest later shaping
A brief note in 1 Samuel explains an older way of speaking about a prophet. The writer pauses to help readers understand a term that was no longer common in the same way (1 Samuel 9:9). That sounds like a narrator writing for a later audience, though it does not tell us exactly how much later.
Another comment says that Ziklag belonged to the kings of Judah "unto this day" in the KJV's wording (1 Samuel 27:6). Since the northern kingdom and Judah became distinct after Solomon's reign, some readers see this as a clue that the final wording came after the kingdom divided. Others are more cautious, since the phrase may simply reflect the writer's own setting. The clue is suggestive, not a date stamped on the page.
(Beforetime in Israel, when a man went to enquire of God, thus he spake, Come, and let us go to the seer: for he that is now called a Prophet was beforetime called a Seer.)
What can we say with confidence?
The safest answer is that 1 Samuel preserves early records from Samuel's and David's world, then was compiled or edited after Samuel's death. Many Bible scholars place its final composition somewhere in the early monarchy or later, and some place it after the division of the kingdom. Faithful Christians differ on the details.
The book's purpose is clearer than its publication date. It shows Israel asking for a king, Saul failing to trust and obey God, and David being chosen while still far from the throne. Read it as a carefully preserved witness to God's work in real history, and let its own story lead your questions.
And Samuel died; and all the Israelites were gathered together, and lamented him, and buried him in his house at Ramah. And David arose, and went down to the wilderness of Paran.
