A leap year is a year containing an extra day. It is tacked on to February, the shortest month of the year, giving it 29 instead of 28 days. A leap year contains 366 days instead of the common 365.
When the concept of the calendar first became codified in the shrouded mists of time, the inventors of the calendar were not aware that the year could not be broken down into a precise number of days. They assumed 365 days per year. What they did not realize was that there was approximately 365 and one quarter days for every year.
According to the Gregorian Calendar: Leap years occur every year that is divisible by four, unless it is divisible by one-hundred, (except years divisible by 400, which are leap years).
The first couple of years, it did not make any difference. But those who used the calendar for record keeping purposes, astronomers, farmers, and mariners, noticed that they could not make precise decisions based on past data. Farmers found fall creeping into summer and winter coming earlier every year. In order to fix this problem, Ptolemy III, a king of Egypt, in the 200s BC, introduced leap years. The Romans adopted this practice and were the first to add the day onto the end of February. They called this the Julian calendar.
Ptolemy's idea was that by adding one day to the calendar every four years the approximate quarter days missed by the 365 day calendar would be corrected for. What he did not account for was the fact that the average year is more like 365.2422 days long. Thus, his calendar would be about 11 minutes and 14 seconds long every year. In the short run, Ptolemy's calendar worked fine. But over the course of a couple hundred years, it was found that these 11 minutes were again screwing up record keeping and throwing off traditional dates for the vernal equinox (one of the ways they kept track of the solar year).
It was Pope Gregory in 1582 who finally corrected for the 11 minutes. He determined that a leap year would continue to occur on every year that was divisible by four. But that any year also divisible by 100 would not be a leap year, unless it was also divisible by 400. But even this adjustment proved not to be 100 percent accurate. It turns out that the Gregorian Calendar is off by about 27 seconds every year (one day every 3236 years). Which means, sometime between now and then another leap year correction will have to be made.
More About Time