The Jewish year starts on Rosh Hashanah, "the Head of the Year," the day when Adam and Eve were created. The number of any given year (at the time of the writing of this article, the year is 5767 (2007)), is the amount of years which have elapsed since creation.
To find the corresponding Jewish year for any year on the Gregorian calendar, add 3760 to the Gregorian number, if it is before Rosh Hashanah. After Rosh Hashanah, add 3761.
A standard Jewish year has twelve months; six twenty-nine-day months, and six thirty-day months, for a total of 354 days. This is because our months follow the lunar orbit, which is approximately 29.5 days. Due to variations in the Jewish calendar, however, the year could also be 353 or 355 days.
The Torah says, "Guard the month of the spring, and make [then] the Passover offering." Meaning, we need to ensure that Passover is celebrated in the spring.
In fact, all the biblical festivals -- Passover, Shavuot and Sukkot -- are dependent on the agricultural seasons. Shavuot is "Chag HaBikurim" (the First Fruits Festival) and Sukkot is "Chag Ha'Asif" (the Harvest Festival). We need to make sure that all the festivals are celebrated in their proper seasons.
Thus the Jewish lunar calendar must coordinate with the cycle of the sun and the seasons which are determined by the solar orbit. The problem is that a lunar year, twelve lunar months added together, only adds up to about 354.4 days. A solar year, at almost 365.25 days, is nearly eleven days longer. If no adjustment is made, Passover would occur eleven days earlier each year, eventually drifting into winter, then fall, summer, and then spring again.
The solution is to periodically insert an extra (thirty-day) month into a year, creating a thirteen-month year. Such a year is called a shanah meuberet ("pregnant year") in Hebrew; in English we call it a leap year, and it makes up all the lunar calendar's lost days. It happens about once every three years.
The month is added to Adar, the last of the twelve months. On leap years we observe two Adars -- Adar I and Adar II.
Thus, the Jewish calendar is both lunar and solar; the months are lunar months while the years are solar years. This is in contrast to the Gregorian calendar, in which the year is a solar year and the months are formed by dividing a year into twelve parts, and is also quite different from the pure lunar calendar observed by certain religions, in which each month is determined by the moon and a year is simply twelve lunar months strung together.
While the Sanhedrin (Rabbinical Supreme Court) presided in Jerusalem, there was no set calendar. They would evaluate every year to determine whether it should be declared a leap year.
When Hillel II instituted the perpetual calendar in anticipation of the disbandment of the Sanhedrin (see Months), he also incorporated leap years into the calendar.
Hillel's calendar runs in nineteen-year cycles, each cycle containing seven leap years: the 3rd, 6th, 8th, 11th, 14th, 17th, and the 19th years.
The length of the standard leap year is 384 days, though it could also be 383 or 385.
There are exactly fourteen different patterns that the Hebrew calendar years may take, distinguished by the length of the year and the day of the week on which Rosh Hashanah falls. Because the rules are complex, a pattern can repeat itself several times in the course of a few years, and then not recur again for a long time. But the Jewish calendar is known to be extremely accurate. It does not "lose" or "gain" time as some other calendars do.
Before the Fix
Sanhedrin considered several factors in the course of their deliberations whether to declare a leap year on a given year. The primary factor, which overrode all others, was the spring equinox. If the spring equinox would fall later than the first half of Nissan (i.e., on the 16th or later), then the year was automatically declared a leap year. This is because, as mentioned earlier, the verse states: "Guard the month of spring, and make [then] the Passover offering."
However, it wasn't enough for Passover to fall after the equinox, when it was "officially" spring; spring-like conditions needed to be evidenced. If in the land of Israel, the barley had not yet ripened, and the trees were not yet blossoming with seasonal fruit -- that, too, was sufficient reason to delay Nissan by adding a second month of Adar. Spring had to be felt; it had to be bright and green.
There were also several non-season-related factors which the Sanhedrin considered. For example, if the roads or bridges were in disrepair due to the winter rainy season, impeding the ability of the pilgrims to travel to Jerusalem for Passover.
For a mystical understanding of the solar-lunar calendar we follow, see The Nineteen-Year Marriage.