The leap year (or intercalary year or bissextile year) is a method of keeping the calendar year in sync with the seasons. The Earth's seasons repeat once every tropical year (the time it takes the Earth to complete an orbit around the Sun). This is about 365.2422 days long, so a consistent 365-day calendar year would over time cause the seasons to slowly drift. By occasionally inserting (or intercalating) an additional day into the year, making it 366 days long instead of the usual 365, this can be corrected. In the Julian and Gregorian calendars this leap day or "intercalary" or "bissextile" day is added to February, making it 29 days long.
By Roman custom, the day added is actually February 24th, with the days following it renumbered. The Romans had marked days during a month: 1st (called calendae--hence "calendar"), 5th or 7th (nonae), 13th or 15th (idus). On these days important events like markets, festivities, and rituals took place. It is possible that in ancient times attempts were made to keep the months in sync with the lunar phases: on occasion an additional day would be inserted inter calendae (hence "intercalary"), i.e. somewhere between those days that should be kept fixed. Now our leap day would repeat the 6th day before the 1st day of March (count including the 1st day itself, as was their custom): hence "bissextile" day, which falls to 24 Feb.
This historical nicety is, however, in the process of being discarded: The European Union declared that, starting in 2000, 29 Feb rather than 24 Feb would be leap day, and the Roman Catholic Church also now uses 29 Feb as leap day. The only tangible difference is felt in countries which celebrate 'name days'.
The rule specified by the Gregorian calendar for leap years is as follows:
The logic behind the above rules is as follows:
By adding a day every four years, an average year is adjusted to 365.25 days. However, this still causes a discrepancy with the vernal equinox tropical year. To make the average year more accurate, a leap year is cancelled in each century. This removes 0.01 days to bring the average to 365.24 days. Unfortunately this is still not accurate enough, hence the cancelled leap year returns once every four centuries. That adds back 0.0025 days to bring the average to 365.2425 days.
This adjusted average is still about 0.0001 days more than the actual mean interval between vernal equinoxes (365.242375 days). As a result, the Gregorian Calendar will still run about a half-day behind in 4000 years. Proposals have been made to add an additional rule: e.g. that years divisible by 4000 are not leap years. Such proposals have not been accepted, since the aim of the Gregorian calendar reform was to keep the vernal equinox steady in the calendar and the Gregorian calendar achieves this long-term goal well enough when considering the changing length of the vernal equinox year in the foreseeable future.
lunisolar, so a leap year has an extra month. In Chinese calendar, the "leap month" is added according to a complicated rule and for example, if it follows the second month then it is simply called "leap second month". In Hebrew calendar, the extra month is called Adar Sheni (second Adar) and is added after Adar. According to the Metonic cycle, this is done seven times every nineteen years. See Chinese calendar and Hebrew calendar for more details.
Notice that the leap year does not have anything at all to do with leap seconds, which are added occasionally based on actual observations of the rotation of the Earth around its axis.