The change between day and night is caused by the rotation of the Earth on its axis. If the Earth did not rotate as it does, the day/night cycle would be very different or possibly even nonexistent. The changing lengths of days and nights depends on where you are on Earth and the time of year. Also, daylight hours are affected by the tilt of the Earth's axis and its path around the sun.
Length of a Rotation
A solar day, 24 hours, is the time it takes for the Earth to rotate exactly once so that the sun appears at the same place in the sky the next day. However, the Earth is also moving around the sun, and this movement makes measuring the day somewhat complicated. The actual time of one Earth rotation is a little shorter – about 23 hours and 56 minutes. Astronomers discovered this by observing the time it took for a star to appear in the same place in the sky the following day, and they called this a sidereal day.
Longer and Shorter Days
Although a solar day is 24 hours, not every day has 12 hours of daylight and 12 hours of night. Daytime is shorter in winter than in summer. This is because the Earth’s imaginary axis isn’t straight up and down, it is tilted 23.5 degrees. As the Earth moves around the sun during a year, the northern half of the Earth is tilted towards the sun in the summer, making daytime longer than night. In winter, this reverses; the earth tilts away from the sun and nighttime becomes longer. In the spring and fall, the tilt is neither toward or away from the sun but somewhere between, so day and night are more the same at these times of the year.
The solstices are the positions of the Earth's orbit that mark the longest and shortest days of the year. The winter solstice in the Northern Hemisphere is the shortest day, after which daylight hours grow longer. The summer solstice in the Northern Hemisphere falls on the longest day, after which daylight hours become shorter. The solstices can also be named for the month in which they occur. For example, the June solstice is the point in the Earth's orbit where the North Pole faces the sun. In the Northern Hemisphere, the June solstice is the longest day of the year. In the Southern Hemisphere, the June solstice is the shortest day of the year.
Position on Earth
Your place on the Earth relative to the equator also affects the number of daylight hours you get in a solar day. For example, during summer in the Northern Hemisphere, daylight hours increase the farther north you go; at this time, the Arctic gets very little nighttime darkness. In the winter, daytime is shorter the farther north you go. The seasonal changes in daylight hours are small near the equator and more extreme close to the poles.