Today – June 20 – is the northern Summer Solstice, sometimes known as the Northern Solstice, “first day of summer”, or Midsummer's Day, depending on where you live. It's the longest day and shortest night of the year in the northern hemisphere (where I live), though exactly how long or short depends on how far north you live. And of course in the southern hemisphere, today is is the shortest day and longest night, since the seasons are reversed.
The secret to the solstice and to Earth's seasons in general involves the tilt of Earth's axis. Our planet orbits the Sun in an elliptical path, which you can draw on a flat piece of paper: it doesn't move “up” or “down”, but stays in a single plane known as the ecliptic. (The name “ecliptic”, as you might guess, is related to the word “eclipse”, since ancient astronomers determined eclipses of the Moon and Sun could only occur at certain places in the sky.) Earth's axis is tilted compared to the ecliptic, and the axis points more or less in the same direction, wherever the planet is in its orbit. The axis points almost directly at Polaris, the North Star, which is why that star is a good navigational guide for those in the northern hemisphere: no matter what time of year, it's always in the same spot in the sky. Other stars rise and set as Earth rotates, but not Polaris. (Unfortunately, there isn't a South Star.)
As you can see from the diagram above, during about half the year, the North Pole points more toward the Sun, while it points more away for the rest of the year. Where I live, the Sun will never be directly overhead, even at noon. The farthest north that will ever happen is a special latitude known as the Tropic of Cancer – and the northern Summer Solstice is the day that occurs. On the northern Winter Solstice, which happens on December 21 or 22, the Sun is directly overhead at noon at the latitude of the Tropic of Capricorn.
Now we can see why summers are hot! In summer, the Sun rises earlier, sets later, and reaches a higher point in the sky. Those things combined mean extra sunlight, heating up the air and the ground longer. We can also see why I put “first day of summer” in quotes: the Solstice is the apex of the process, but the increase in daylight and temperatures begins long before June 20 (at least every place I've lived). The Midsummer's Day festival, celebrated throughout northern Europe, acknowledges that; Shakespeare's play A Midsummer Night's Dream may have been written for the English version of the festival (though from what I can tell, the historical evidence is scant).
Similarly, during winter the Sun's light comes in at a steeper angle and days are shorter, so the time for the ground to warm is greatly reduced. The northern Winter Solstice (also known as the Southern Solstice, “first day of winter”, Midwinter's Day, or Yule) is the shortest day and longest night of the year in the northern hemisphere. On that day, the North Pole points as far away from the Sun as it ever does. We also have the reason the tropics are warm all year around: they receive about the same amount of sunlight during both summer and winter.
Approximately halfway between the solstices, the Sun appears directly overhead at noon at the Equator. On those days, everywhere on Earth gets about 12 hours of daylight and 12 hours of night. These days are the equinoxes, meaning “equal night”. (The spell to extinguish light in the Harry Potter books is “nox”, for what it's worth. Yes, I remember such things. I'm still waiting for my “accio!” summoning spell, though.) The two days are known as the Vernal (or spring) and the Autumnal (or autumn) Equinox, again based on the seasons in the northern hemisphere. From an astronomical point of view, Earth's “solar year” is marked between successive vernal equinoxes. (A second measurement of the year, known as the sidereal year, is measured with respect to the stars. These two year measurements are almost, but not quite, the same length!)
Now let's put all of this together in a movie! (For some reason, the Sun – which was a gently glowing lamp in my original simulation – came out looking flat and boring in the final movie. I guess I still have more to learn about creating three-dimensional animations.) For best results, please view this full-screen.