A lunar day is the length of time it takes for the Moon to make one complete rotation on its axis compared to the Sun. This is important because the Moon is tidally locked with respect to the Earth. So it always points the same face towards the Earth as it goes around the planet. So, how long is a day on the Moon?
The lunar day lasts 29 days, 12 hours and 44 minutes. And this the same time it takes for the Moon to orbit around the Earth.
With respect to the background stars, however, the Moon only takes 27 days and 7 hours for the sky to completely rotate back to its original position.
So why is there a difference?
As the Earth and Moon are orbiting around the Sun, they complete a circle over the course of the year. Each time the Moon goes around the Earth, it needs to go a little further to get the Sun back into the same position.
If you ever get the opportunity to stand on the surface of the Moon, and look at the Earth, our planet would always remain in the exact same position in the sky. The Sun, on the other hand, will still rise, move across the sky and then set. Of course, an average day will last 29 days, 12 hours and 44 minutes until the Sun returns to the same position in the sky.
Astronomers say that the Moon is tidally locked to the Earth. At some point in the distant past, the Moon rotated more rapidly than it currently does. The Earth’s gravity caused part of the Moon to bulge out. The pull of gravity caused the rotation of the Moon to slow down until this bulge was pointing directly at the Earth. At this point, the Moon was tidally locked to the Earth; this is why it shows the same face to us.
And it’s also why a lunar day lasts the same as it takes the Moon to go around the Earth.
You can listen to a very interesting podcast about the formation of the Moon from Astronomy Cast, Episode 17: Where Did the Moon Come From?