A leap year (or intercalary year) is a year containing an extra day or month in order to keep the calendar year in sync with an astronomical or seasonal year. Seasons and astronomical events do not repeat at an exact number of days, so a calendar which had the same number of days in each year would over time drift with respect to the event it was supposed to track. By occasionally inserting (or intercalating) an additional day or month into the year, the drift can be corrected.
Leap years (which keep the calendar in sync with the year) should not be confused with leap seconds (which keep clock time in sync with the day).
The Gregorian calendar adds an extra day to February, making it 29 days long, in years divisible by 4, excluding years divisible by 100, but including years divisible by 400. So 1996, 2000, and 2400 are leap years but 1899, 1900 and 2100 are not.
The reasoning behind this rule is as follows:
- The Gregorian calendar is designed to keep the vernal equinox on or close to March 21, so that the date of Easter (celebrated on the Sunday after the 14th day of the Moon that falls on or after March 21) remains correct with respect to the vernal equinox.
- The vernal equinox year is currently about 365.242375 days long.
- The Gregorian leap year rule gives an average year length of 365.2425 days.
This difference of a little over 0.0001 days means that an error of a day will accumulate in around 8,000 years. But in 8,000 years' time the length of the vernal equinox year will have changed by an amount we can't accurately predict (see below). So the Gregorian leap year rule does a good enough job.
Which day is the leap day?
The Gregorian calendar is a modification of the Julian calendar first used by the Romans. The Roman calendar originated as a lunar calendar (though from the 5th century BC it no longer followed the real moon) and named its days after three of the phases of the moon: the new moon (calends, hence "calendar"), the first quarter (nones) and the full moon (ides). Days were counted down (inclusively) to the next named day, so 24 February was ante diem sextum calendas martii ("the sixth day before the calends of March").
Since 45 BC, February in a leap year had two days called "the sixth day before the calends of March". The extra day was originally the second of these, but since the third century it was the first. Hence the term bissextile day for 24 February in a bissextile year.
Where this custom is followed, anniversaries after the inserted day are moved in leap years. For example, the former feast day of Saint Matthias, 24 February in ordinary years, would be 25 February in leap years.
This historical nicety is, however, in the process of being discarded: The European Union declared that, starting in 2000, 29 February rather than 24 February would be leap day, and the Roman Catholic Church also now uses 29 February as leap day. The only tangible difference is felt in countries which celebrate 'name days'.
The Julian calendar adds an extra day to February in years divisible by 4.
This rule gives an average year length of 365.25 days. The excess of about 0.0076 days with respect to the vernal equinox year means that the vernal equinox moves a day earlier in the calendar every 130 years or so.
Revised Julian Calendar
The Revised Julian calendar adds an extra day to February in years divisible by 4, except for years divisible by 100 that do not leave a remainder of 200 or 600 when divided by 900.
This rule agrees with the rule for the Gregorian calendar until 2800 (a leap year in the Gregorian calendar but not in the Revised Julian calendar).
This rule gives an average year length of 365.242222… days. This is a very good approximation to the mean tropical year, but because the vernal equinox tropical year is slightly longer, the Revised Julian calendar does not do as good a job as the Gregorian calendar of keeping the vernal equinox on or close to March 21.
Chinese calendar and Hebrew calendar
Both the Chinese calendar and the Hebrew calendar are lunisolar, so a leap year has an extra month, often called an embolismic month after the Greek word for it.
In the Chinese calendar the leap month is added according to a complicated rule, which ensures that month 11 is always the month that contains the northern winter solstice. The intercalary month takes the same number as the preceding month; for example, if it follows the second month then it is simply called "leap second month".
In the Hebrew calendar the extra month is called Adar Rishon (first Adar) and is added before Adar, which then becomes Adar Sheni (second Adar). According to the Metonic cycle, this is done seven times every nineteen years, specifically, in years, 3, 6, 8, 11, 14, 17, and 19.
The Iranian calendar also has a single intercalated day approximately once in every four years, but a more accurate, and more complicated, system determines which years are leap years in the Iranian (or Persian) calendar.
Long term leap year rules
The accumulated difference between the Gregorian calendar and the vernal equinoctial year amounts to 1 day in about 8,000 years. This suggests that the calendar needs to be improved by another refinement to the leap year rule: perhaps by avoiding leap years in years divisible by 8,000.
(The most common such proposal is to avoid leap years in years divisible by 4,000  (http://www.google.com/search?q=%22gregorian+calendar%22+error+%22leap+year%22+4000). This is based on the difference between the Gregorian calendar and the mean tropical year. Others claim, erroneously, that the Gregorian calendar itself already contains a refinement of this kind  (http://www.straightdope.com/mailbag/mleapyr.html),  (http://www.llywelyn.net/docs/misc/calendar.html).)
However, there is little point in planning a calendar so far ahead because over a timescale of tens of thousands of years the number of days in a year will change for a number of reasons, most notably:
- Precession of the equinoxes moves the position of the vernal equinox with respect to perihelion and so changes the length of the vernal equinoctial year.
- Tidal acceleration from the sun and moon slows the revolution of the earth, making the day longer.
In particular, the second component of change depends on such things as post-glacial rebound and sea level rise due to climate change. We can't predict these changes accurately enough to be able to make a calendar that will be accurate to a day in tens of thousands of years.
There is a tradition, said to go back to Saint Patrick and Saint Bridget in 5th century Ireland, whereby women could only make marriage proposals in leap years.
Saint Patrick and the leap year
- Saint Patrick, having driven the frogs out of the bogs was walking along the shores of Lough Neagh, when he was accosted by Saint Bridget in tears, and was told that a mutiny had broken out in the nunnery over which she presided, the ladies claiming the right of popping the question.
- Saint Patrick said he would concede them the right every seventh year, when Saint Bridget threw her arms round his neck, and exclaimed, "Arrah, Pathrick, jewel, I daurn't go back to the girls wid such a proposal. Make it one year in four." Saint Patrick replied, "Bridget, acushla, squeeze me that way again, an' I'll give ye leap-year, the longest of the lot." Saint Bridget, upon this, popped the question to St Patrick himself, who, of course, could not marry: so he patched up the difficulty as best he could with a kiss and a silk gown.
(Source: Evans, Ivor H, Brewer's Dictionary of Phrase and Fable, Cassell, London, 1988)
According to a 1288 law in Scotland, fines were levied if the proposal was refused by the man; compensation ranged from a kiss to a silk gown to soften the blow. Because men felt that put them at too great a risk, the tradition was in some places tightened to restricting female proposals to 29 February.