It depends on how you define autobiography. Egyptian and Mesopotamian kings often ordered inscriptions to be spread throughout their empire or buried beneath their building works with accounts of their heroic deeds. The practice goes back thousands of years, and continued right up to the Persian king Darius I (late 6th century BC). Archaic Greek poetry often contained references to the poet's life; authors like Sappho and Archilochos wrote in the first person, apparently commenting on their own experiences. Greek grave monuments often boasted about the achievements of the deceased, sometimes in general terms, sometimes with specifics. This was also the habit of the Romans, who sometimes inscribed their gravestones with accounts of their whole lives.
I'm guessing, though, that you're looking for autobiography as a form of historical writing. The earliest example of this is Thucydides' account of his own service as an Athenian general in 424 BC. He arrived too late to prevent the town of Amphipolis falling into Spartan hands, and was exiled for his failure. However, this is just a small piece of Thucydides' account of the Peloponnesian War. He writes coolly about himself in the third person and tries to make the whole campaign look unimportant compared to the huge battle that the Athenians fought and lost at Delion in the same year.
The more famous example from Classical Greece is Xenophon's Anabasis, written in the 380s BC. The book tells the story of how Kyros the Younger, brother of the Persian king Artaxerxes II, gathered an army to try and seize the Persian throne in 401 BC. After Kyros' army was defeated and Kyros was killed, the Greek mercenaries he hired had to make their way back from Babylon to Greece. In this part of the story, the role of Xenophon himself becomes more and more prominent; he joined the expedition only as the friend of one of the commanders of the Greeks, but he eventually ends up being elected leader of the whole mercenary force. Xenophon describes how he went with the army through what is now Eastern Turkey to the Black Sea coast, then all the way back to the Aegean, where the mercenaries were eventually hired by the Spartans.