The longest day of the year occurs at the summer solstice, falling around June 20–21 in the Northern Hemisphere and December 20–21 in the Southern Hemisphere. The shortest day occurs at the winter solstice, around December 21–22 in the Northern Hemisphere and June 20–21 in the Southern Hemisphere.
These solstices happen because of Earth's axial tilt. As Earth orbits the sun, its tilted axis causes different hemispheres to receive varying amounts of sunlight. At the summer solstice, your hemisphere is tilted maximally toward the sun, resulting in the sun's highest arc across the sky and the most daylight hours. At the winter solstice, your hemisphere tilts maximally away from the sun, creating the lowest arc and fewest daylight hours.
The exact date varies slightly year to year due to how Earth's orbital and rotational cycles align with our calendar. The difference in daylight between solstices is more dramatic at higher latitudes—locations near the poles experience extreme differences, while equatorial regions have roughly equal day and night year-round.
Between the solstices, the equinoxes (around March and September) mark points where day and night are nearly equal length globally, though "equinox" means "equal night" rather than perfectly equal daylight.