It takes the sun 365.242190 days to get round the sun (a solar year or tropical year). Because the calendar year is 365 days, that means we need to add an extra day every four years to keep the calendar year and the solar year in sync. In 1582, the calendar lost ten days – October 4th was followed by October 15th.

Leap years are years that are divisible by four, except… years that are also divisible by 100 are not leap years, unless they are also divisible by 400, when they are leap years. Got that?