In most languages, the word month is derived from the word "moon". Many calendars started by counting the number of full moons in a year, and the amount of days in each one of those cycles.
More complex astronomical events like equinoxes and solstices added some more accuracy to them, and some civilizations built structures to track those events.