HaKadosh Baruch Hu created luminaries – the sun and the moon – and placed them in the heavens. They are the means by which we establish the order of time. The sun shines during the day, the moon at night. The order of years is determined by the cycle of the sun, and the months are based on the moon’s. As the Torah states: “God said, Let there be luminaries in the firmament of heaven to separate between the day and the night; and they will be for signs, and for appointed times, and for days and years”(Bereishit, 1:14).
Every month, the moon makes one orbit around the earth. This cycle is perceivable by the changes in the moon’s appearance. At the beginning of the month, the moon looks like a thin sliver. Gradually, it increases in size until the middle of the month, when it reaches its fullness, appearing as a complete circle. During the second half of the month, the moon wanes, until it completely disappears at the end of the month for approximately twenty-four hours. Afterwards, it reappears as a thin sliver, indicating that a new month has begun.
A full lunar cycle lasts 29½ days, plus, approximately, another three-quarters of an hour. Since this cycle does not coincide with the earth’s daily rotation around its axis, due to the extra half-a-day, a Jewish month lasts either twenty-nine or thirty days. A 29-day month is called an “incomplete month,” while a 30-day month is called, a “full month.”
Establishing the beginning of a month is extremely important, for all of our holidays depend on the Hebrew date: Passover commences on the fifteenth of Nisan, Yom Kippur falls out on the tenth of Tishrei, Sukkot begins on the fifteenth of Tishrei, etc. In fact, it is so important that the Torah permits witnesses who see the new moon to violate the Sabbath in order to travel to Jerusalem and give testimony before the Beit Din(Rambam, Kiddush HaChodesh 3:2). The Beit Din (rabbinic court) would sanctify the new month based on their testimony, and then dispatch messengers to inform all of Israel that the new month had begun.
 The exact duration is 29 days, 12 hours, and 793/ 1080 of an hour. The division of an hour into 1080 parts was designed to simplify complex calculations. All of this is explained in the Rambam’sHilchot Kiddush HaChodesh 6:1-3.