The Romans had a list of consuls. The first two consuls (the ordinary consuls) of the year gave the year its name. For instance, the year 59 B.C. was the year of Gaius Julius Caesar and Marcus Calpernius Bibilus, the year 28 B.C. the year of Augustus and Agrippa and so on. The further we go back in time these records get somewhat more dubious.
Many Roman historians also used the phrase "ab urbe condita" or AUC, which meant from the founding of the city, to keep track of dates. This was not as popular as the method explained by azdac7, referencing the list of consuls, but was still used nonetheless. It was a very Roman way of viewing the world, as from this perspective all time began with the traditional founding date of the city of Rome in 753BCE.