In Biblical times, Jewish communities used a lunar calendar which included intercalary months at times determined by the Sanhedrin, the council of religious leaders. By the fourth century of the Christian era, this had been replaced by a calendar which followed explicit rules. It was still based upon the lunar month, but intercalary months were inserted according to the Metonic cycle which made 19 tropical years equal to 235 lunar months.
The first month of the Hebrew year is named Tishri, and it falls in the autumn. The second and third months, named Heshvan and Kislev, may have 29 or 30 days. In a leap year, the sixth month, Adar, is repeated, the first time (Adar I) with 30 days and the second (Adar II) with 29.
The length of the Hebrew year is therefore rather variable. In an ordinary year, it can be 353, 354 or 355 days long; in a leap year, it may be 383, 384 or 385 days. Years of 353 or 383 days are called "deficient" years whilst those of 355 or 385 are called "complete".
Leap years occur in years 3, 6, 8, 11, 14, 17 and 19 of the 19-year Metonic cycle.
There are a number of rules, known as dehiyyot, which are used to decide whether the first day of the new year (i.e. Tishri 1) must be postponed. These rules prevent Hoshana Rabba from falling on the Sabbath, and Yom Kippur from falling on the day before or the day after the Sabbath¹. They also ensure that the adjustments do not cause the length of the year to fall outside the acceptable range.
¹ I am grateful to Mr Eli Boroditsky for correcting an error in a previous version of this web page.