There are two basic sources for calendars presently in use: the monthly motion of the Moon (Lunar calendars) and the yearly motion of the Sun (Solar Calendars). Examples of Lunar calendars still in use are the traditional Jewish and Chinese calendars. The difficulty with Lunar calendars is that the seasons are correlated with the Sun, not the Moon. Thus, Lunar calendars require elaborate adjustments or translations to relate to the seasons. That calendars correlate with seasons is now primarily a matter of convenience, but in more ancient cultures keeping track of the seasons was serious business: it could be a matter of survival to know things like the proper time to plant to ensure a bountiful harvest.
The Roman Lunar Calendar
Our present calendar (called the Gregorian Calendar) is a basically solar calendar that grew from what was originally a Lunar calendar used by the Romans. The original calendar contained 10 months of length 29 or 30 days. This was later modified to a 12 month calendar, but 12 months of average length 29.5 days gives only 354 days in the year, whereas the orbital period of the Earth is 365.242199 days. Thus, at the end of each year this calendar was 11 days out of step with the seasons and at the end of 3 years it was almost a month out of step. This was initially corrected in an arbitrary way by adding 13th months, but this was used for various political purposes and soon threw the calendar into severe confusion.
The Julian Calendar
In 46 B.C., Julius Caesar reformed the calendar by ordering the year to be 365 days in length and to contain 12 months. This forced some days to be added to some of the months to bring the total from 354 up to 365 days, so the months now were out of phase with the cycles of the Moon: although the Julian Calendar retained monthly divisions, it was no longer a Lunar calendar. The Julian Calendar improved things tremendously, but there was still about a quarter day difference between the true length of the year and the 365 days assumed for the Julian Calendar. Thus, February was given an additional day every 4 years (leap years) and the average length of the Julian year with leap years added was 365.25 days.
The Gregorian Calendar
However, the Julian year still differs from the true year of 365.242199 days by 11 minutes and 14 seconds each year, and over a period of 128 years even the Julian Calendar was in error by one day with respect to the seasons. By 1582 this error had accumulated to 10 days and Pope Gregory XIII ordered another reform: 10 days were dropped from the year 1582, so that October 4, 1582, was followed by October 15, 1582. In addition, to guard against further accumulation of error, in the new Gregorian Calendar it was decreed that century years not divisible by 400 were not to be considered leap years. Thus, 1600 was a leap year but 1700 was not. This made the average length of the year sufficiently close to the actual year that it would take 3322 years for the error to accumulate to 1 day.
A further modification to the Gregorian Calendar has been suggested: years evenly divisible by 4000 are not leap years. This would reduce the error between the Gregorian Calendar Year and the true year to 1 day in 20,000 years. However, this last proposed change has not been officially adopted; there is plenty of time to consider it, since it would not have an effect until the year 4000.
Adoption of the Gregorian Calendar
An interesting historical sidelight on the Gregorian Calendar is that not all countries adopted it immediately. In particular, it was adopted uniformly in Catholic countries, but Protestant countries often still used the Julian Calendar. Thus, the date could change by 10 days simply by crossing certain country borders! England and its American colonies did not adopt the Gregorian Calendar until 1752, when 11 days were removed from the calendar, and Russia resisted this change until after the 1917 Revolution. One consequence of the British adoption of the Gregorian Calendar in 1752 is that George Washington was born on February 11, 1731, according to the calendar in use on his birthday, but we now celebrate his date of birth as February 22, 1731 (actually, even that is no longer true with the advent of Presidents Day).