In our modern western calendar, months have varying lengths between 28 and 31 days, which cycle in an ad hoc pattern which dates back to Roman times.
In many older calendars, however, each month represents the amount of time that the Moon's phases take to complete one cycle: on average, 29.530589 days. In such calendars, the time of month is tied directly to the phase of the Moon. There are still some cultures which use these lunar calendars.
The Moon's phases are an important cycle. Before the advent of street lighting, the Moon was the only easily-available and abundant source of lighting after nightfall. However, calendars such as our own have broken any connection with the phases of the Moon due to a difficult mathematical inconvenience.
The Earth's seasons repeat once every 365.2422 days. This time period is the tropical year: the time period over which the Earth's solstices and equinoxes repeat.
The Moon's phases repeat once every 29.530589 days – once every synodic month. And here lies a problem: there are not an integer number of days in a month, nor an integer number of months in a year. 12 lunar months last under 355 days, while 13 lunar months last over 383 days. Any calendar with either 12 or 13 lunar months in a year would very rapidly drift with respect to the seasons.
Devising a calendar in which there are an integer number of days in each month, and an integer number of months in each year is not easy. The solutions that calendar makers have adopted in various cultures can be divided into three categories: solar calendars, lunar calendars, and luni-solar calendars.
Our familiar western calendar puts great effort into matching the exact period over which the seasons repeat: the tropical year of 365.2422 days. Leap days are inserted into roughly every fourth year, giving each year an average length of 365.2425 days. The mismatch is so small that the Earth's seasons, as measured by the solstices and equinoxes, drift later in the year by only 26 seconds each year.
This is what's called a solar calendar. The years keep in step with the Earth's seasons, but the months are merely arbitrary divisions of each year into twelve unequal pieces.
The Moon completes twelve cycles of its phases in 354.37 days, some 11 days short of the length of year, meaning that in consecutive years, the full moons fall roughly 11 days earlier in each month from one year to the next.
A lunar calendar is one in which the months keep precisely synchronised to the Moon's phases, but the Earth's seasons drift relative to the time of year.
One example of such a calendar is the Islamic calendar, in which months are defined to start and end at every new moon. Each year comprises of exactly twelve months, with an average length of 354.37 days.
This means that years in the Islamic calendar do not stay synchronised with the Earth's seasons. The seasons fall roughly 11 days later in the calendar each year.
Some calendars take a more complicated approach, and keep track of both the Moon's phases and the seasons.
One example is the Hebrew / Jewish calendar. Just as in the Islamic calendar, the months are defined to start and end at every new moon.
The difference is that years in the Jewish calendar can have either 12 or 13 months. Whenever the seasons move too far forward in the year, an extra intercalary month is inserted into the calendar to push them back to their rightful places.
In the fifth century BC, the Greek astronomer Meton of Athens observed that the duration of 19 years very closely equals 235 synodic months. This means that seven intercalary months need to be inserted into the Jewish calendar every 19 years.
Other kinds of months
The Moon's cycle of phases are not the only way that the month can be defined, even if it is the most obvious.
For example, the Moon circles the Earth once every 27.321661 – each sidereal month. This is a slightly shorter period of time than a synodic month, because the Sun is continuously moving across the sky, completing one complete revolution around the celestial sphere each year. This means that it moves by 30° across the sky each month, and to get from one new moon to the next the Moon must do more than complete one full revolution around the Earth: it must also cover this additional 30° to catch up with the Sun once again.
The Moon's orbit is slightly oval-shaped, and this means that its distance from the Earth varies by 13% over the course of each month. The period between its close approaches to the Earth is yet another time period still: 27.212220 days, or one draconic month.
The draconic month would be the same period of time as a sidereal month if the Moon traced out exactly the same path around the Earth on each orbit. However, in practice, the point where the Moon passes perihelion on each orbit precesses around the Earth with a nine-year period due to the perturbing effect of the Sun's gravity on the Moon's orbit around the Earth.