Moon, the natural satellite of your planet Earth, has phases because of its orbiting around the earth. The calendar that is based upon the cycles of the phases of the Moon or the lunar phases is called a lunar calendar. In religions like Hinduism, Islam, Christianity and civilizations like Chinese etc. there are different lunar calendars according to changing phases and seasons but the most widely and popularly used lunar calendar is the Islamic Calendar in which there are 12 lunar months in a year. Most of the lunar calendars, except the Hijri calendar, are lunisolar calendars in with the months are kept over the cycle of the lunar phases but the intercalary months are added to get the lunar cycles in harmony with the solar year.
Since a single year is not completely divisible by exact number of the lunations, these calendars have variable number of months. If the intercalary months are not added then the seasons may get drifted each year which will lead to the thirteen month year after every three years. There are some natural annual events that influence solar as well as lunar cycles and thus can be used to calibrate the lunar calendars. You can download your lunar calendar from the internet for free and see how the phases of the moon vary with each passing day.