Quick- how long is a year?
If you answered 365 days, you are mostly correct. In actuality, the Earth takes just a bit longer to go around the Sun- about 6 hours. In 4 years, this 6 hour difference amounts to 24 hours, or one day. Hence, the need to add an extra day every 4 years. However, the time is not exactly 6 hours, its more like 5 hours, 49 minutes, and some seconds. That means that if we keep adding leap days every 4 years, we'll eventually be too far forward. This is on why every year that's divisible by 100 a leap day is NOT included. But wait! If we never include those years we'll eventually lag behind. So years that are divisible by 400, even though they are also divisible by 100, are considered leap years and include a leap day. So 2000 was a leap year, but 1900 was not. Even that isn't perfect, but it's good enough. We should be fine for several thousand years or so with this system in place.
All of this applies to the Gregorian calendar, which is the most widely used calendar in the world. If you rely on alternative calendars, like the Chinese lunar calendar, the rules for leap days/months/years are different.
Why all the worry about how long the year is?
Note that in all this, we've been using the tropical or solar year which relies on the position of the Sun and the vernal equinox. There exists another definition of the year, the sidereal year, which relies on the position of distant stars and is a bit longer by about 20 minutes. More on this later.
What the solar year along with those leap years accomplishes is that the vernal equinox occurs at or very near March 21st. This ensures that the seasons remain synced with our calendar- northern hemisphere Summer, for example, is during June through August.
What is the vernal equinox?
This actually has two answers, both related. The first definition of the equinox is the location in the sky where the plane of the solar system (the ecliptic), or equivalently the path of the Sun, intersects the equator of the Earth as projected into space. It is currently located in the constellation Pisces. There is, equivalently, another equinox, the autumnal equinox where the same situation occurs. This one is near Virgo. These locations are also known as the first point of Aries / Libra, however, the precession of the Earth's axis has meant that these are no longer located in Aries and Libra.
|The equinox is the point in space where the ecliptic and the celestial equator intersect. Credit: Dennis Nilsson, Creative Commons|
The other definition of the equinox is the day in which the Sun spends an equal amount of time above and below the horizon. Basically, day and night are equal. This occurs when the Sun is physically located at or near the point defined above. In our year, this is about March 21 and September 21 and signals the onset of Spring and Fall. By making sure the equinoxes land near these days we ensure that the seasons occur at about the same time each year.
Note that we also have solstices where the amount of daylight is the shortest or longest in a year. These occur around December 21 and June 21 and correspond to the winter and summer solstices, respectively. These likewise corresponds to particular points in space: the first point of Cancer / Capricorn. Due to precession though (as I'll describe below) these are no longer located in Cancer and Capricorn but now are in the constellations Gemini and Sagittarius.
Why not use the sidereal year?
Using the sidereal year makes some sense, to me at least, since we're comparing to more distant and therefore fixed stars. The length of time of the sidereal year and the tropical year differ, however. An important consequence of this is that over time the constellations will drift throughout the year. For example, Orion is a very prominent constellation seen in the (northern) Winter months, like January. Over a period of 13,000 years or so you will no longer see it in Winter. Instead, you will see it in Summer, around July or so. This is because our calendar is synced to the seasons, not to the stars.
Another interesting and related consequence is that the location (but not the DATE) of the equinoxes will change. The vernal equinox, for example, is known as the first point of Aries because when it was defined the equinox was in the constellation Aries. Now, thousands of years later, the equinox is in Pisces, one constellation west of Aries. Do you know your astrological sign? If you look up on the newspaper they'll tell you so-and-so date corresponds to so-and-so sign. The reasoning is that the Sun would be in that constellation on those dates. However, these were defined thousands of years ago and, as I've just mentioned, the constellations have drifted. Hence, the sign you think you are is probably incorrect. That's one reason why you shouldn't be trusting astrological predictions.
Why don't the sidereal year and solar year match?
If you look at the figure of the Earth above, you'll notice that the line perpendicular to the ecliptic (the plane of the orbit) doesn't match the rotation axis of the Earth. The Earth's axis is tilted by about 23.5 degrees. The gravitational influence of the Sun and the Moon apply a small torque which causes the axis to precess like a spinning top over a period of about 26,000 years. That means the Earth axis won't always be pointed at the same location in space at all times and thus we won't always have a North Star.
|The precession of the Earth's axis (yellow) causes the North Celestial Pole to trace out a circle in the sky (blue line). The track the vernal equinox covers is denoted in red.|
Let's consider an example: in the summer solstice the Earth's northern axis is pointed at the Sun and, say, background star X. Throughout the year the precession results in a slight change of the Earth's axis. The result is that a solar year later the axis points again at the Sun, but because of that slight change we need an additional 20 minutes or so for the axis to point to the same background star X. This would mark the sidereal year, but at that time the axis would no longer be pointing exactly at the Sun.
To summarize: we need a leap day so that our calendar remains synced to the seasons given that the year is slightly over 365 days long. Because of the tilt of the Earth's axis, however, we have two separate ways of defining a year. By focusing on keeping the seasons in line, when we see the constellations will drift across the year over a period of several thousand years.
For a more math-related discussion, check out the Bad Astronomer's take on leap days
Update: Check out these two short videos to learn more about the leap year:
Minute Physics (with a shout-out to the UCLA Galactic Center group!) and CGPGrey