First of all, the each Jewish (and biblical) day begins the evening before at sunset, and ends 24 hours later at sunset. The Jewish month begins with the first visible appearance of the crescent of the new moon. There are two Hebrew words for month: Yerach, also the word for moon, and chodesh, which is related to the word for "new." The first day of the Jewish month is called a Rosh Chodesh, meaning head of the month.
The lunar month is about 29 1/2 days. Therefore, each month of the Jewish calendar is either 29 or 30 days. Rabbinically, certain holidays may not fall on certain days. For example, the important fast day of Yom Kippur (Day of Atonement) may not occur on the day before Shabbat (the Sabbath), or on the day after Yom Kippur. If it did, there would be two days in a row in which Jews (according to Jewish law) would not be able to cook food or bury the dead. This is especially important for hot climates where there is no refrigeration and food spoils quickly and decay sets in rapidly after death.
The date of the New Year (Rosh HaShanah) sets the dates in which the other holidays (such as Yom Kippur) that are observed during that month (Tishrei). Therefore, the Jewish New Year (Rosh HaShanah) must never occur on a Sunday, Wednesday, or Friday. If the Rosh Chodesh were on a Sunday, Hoshana Rabba, which is the holiday when the willow branches were prepared and beaten would fall on Shabbat. If Rosh HaShanah were on a Wednesday of Friday, Yom Kippur would occur on Friday or Sunday. Therefore, there is occasionally some rabbinic tinkering to the number of days in some months to prevent certain holidays from conflicting with Shabbat.
We personally follow the Rabbinic reckoning for the new moons and holidays, with one exception: Biblically, the 50-day count to Shavuot (Pentecost) begins on the day after the Shabbat that occurs during Passover (Lev. 23:11), which is always on Sunday, and ends on the day after the seventh Shabbat (Lev. 23:15-16), which of course is also Sunday. Rabbinically, the count begins on the day after the first day of Passover, which is not biblical. Rabbinically, Shavuot can occur any day of the week, whereas biblically, Shavuot is always on the first day of the week, which begins at sunset on Saturday and ends on Sunday at sunset. Sunday during the month of Sivan, by the way, is the same day in which the ancient Sad-ducees as well as the more modern Karaite Jews celebrate Shavuot. Orthodox and Conservative Jews follow the Pharisaic reckoning.
It should also be noted that twelve lunar month year is about 354 days long. There is a 19 year cycle of years on the Jewish calendar. Seven times within that 19 year period, there is an extra month of Adar added to the Jewish calendar to keep all of the holidays in synch with the seasons. Otherwise, the Spring holiday of Passover which fall ten days earlier each year, until it became an autumn holiday. Therefore, seven times in 19 years, there is a Jewish "leap year" in which there are 13 months instead of 12 months. In much the same way the Gregorian calendar has an extra day added every four years, making a 366 day leap year.
Muslims have 12 lunar months in each of their years, with no correction by having an extra month added at regular intervals. Therefore, most years on the Islamic calendar have only about 354 days every year. The Muslim calendar is strictly a lunar calendar.
In ancient times, the beginning of the month was determined by the actual sighting of the new moon. This would be rough for us in Rochester, NY. With all the cloudy days we have, we might not even see the crescent of the new moon for a few days.
The present calculated Jewish calendar system is believed to have been introduced by the patriarch Hillel II in 359 CE, which was in the Jewish year 4119. This was at the demand of the Roman emperor, who didn't want to be surprised by any Jewish holiday suddenly appearing by surprise. The Hillel calendar has been used ever since, and is incredibly precise, keeping the biblical holidays in synch with the seasons. The Jewish calendar is a lunar-solar calendar with the correction of adding an extra month of Adar as needed. The Gregorian calendar is a strictly solar calendar. The phases of the moon have nothing to do with the beginning of the calendar months.
Most of the information above is from JCAL, a software Jewish calendar program. Regretfully, this software is no longer available.
I used to use Kaluach, which was an excellent Jewish calendar software program. Unfortunately, it got infected with a virus, so I can no longer recommend it.
 "Common Era," equivalent to A.D.