Daytime on the Moon lasts for about 14 Earth days due to the Moon's synchronous rotation with Earth, which aligns its day-night cycle with its orbit. This results in a total lunar day/night cycle of approximately 29.5 days.
The duration of the lunar daytime, which refers to the amount of time from sunrise to sunset on the Moon's surface, spans approximately 14 Earth days. This is due to the Moon's sidereal rotation period of 27.3217 days and its synodic period (the time it takes to realign with the Earth and Sun for the lunar phases, like from full moon to full moon) of 29.5306 days. The difference between these two periods results in the lunar day/night cycle being roughly 29.5 days in total, half of which is daytime and the other half nighttime.
Consequently, the lengthy lunar days and nights are the result of the Moon's synchronous rotation with Earth. This means as the Moon completes its orbit around Earth, it also completes one rotation on its axis, leading to two-week-long periods of day and night.
So, understanding the Moon's rotation and revolution around Earth helps explain why the length of a single 'day' on the Moon is much longer than an Earth day. The phases of the Moon, as observed from Earth, are also related to this elongated day-night cycle witnessed on the lunar surface.