Every four years, an extra day is added to the calendar in order to synchronize it with the solar year.
It takes the earth 365.242 days to orbit the Sun. For this reason, the full day is only added once every four years.
The extra day, called leap day or intercalary day, is added at the end of February, giving it 29 days instead of 28.
Leap year occurs in every year that is divisible by four and only in century years that are evenly divided by 400. For example, 800, 1200, 2000 were leap years but 1700 and 1900 were not because they are not divisible by 400, even though they are divisible by four.
The practice of adding the extra day began with the creation of the Julian calendar and a decree by Julius Caesar in the year 46 B.C. The Julian calendar creates an extra day every four years, and does not follow the century-divisible-by-400 rule so there is still an 11-minute, 14-second discrepancy each year.
The 11-minute discrepancy in the Julian calendar had added up to ten days by the year 1582 A.D. so Pope Gregory XIII created the Gregorian calendar and dropped ten days from the month of October. He also established February 29 as the official date to add during a leap year, coined the term leap year, and created the rules for adding the leap year.
Currently the solar year is approximately 26 seconds shorter than the Gregorian year.
In the U.S., leap year coincides with presidential election years.