Many Christians and Muslims would have you believe the 7 calendar days were brought on by the creation of the universe brought about by their God in genesis. Others more enlightened would say it was popularize by the Roman’s with the Julian calendar and what followed the Georgian calendar. While this is somewhat true, the concept of a 7 day week existed and was popularized long before that of the Roman state by the Jewish state; and even long before that with the Mesopotamian empires. Sargon of Akkad was known to conquer cities and establish 7 day calendar weeks.
The real answer is simple and it lays in the cycle of the moon phases. The early Babylonians-Mesopotamian astronomers observed the moon life cycles to be approximately 29.5 calendar days, which they rounded down to 28, and then divided that by 4 periods of 7 days even calculating leap days. The name of each day was after the 7 classical planets. The leap years were more so established and popularized by the Romans. So now you know. 😉