Days around the time of the summer solstice are the year's longest. Even with the year's longest days, the hottest weather arrives about a month later for most places. The graphic here uses Chicago as an example of how the hottest weather lags the longest days of the year. This happens because even as the days grow shorter, the amount of solar heat arriving at the ground is greater than the amount of heat leaving the earth. The days continue growing hotter as heat accumulates.
Weather begins cooling when the balance shifts to more heat leaving than arriving.
Temperature figures here are 30-year averages. For more on why the longest days aren't the hottest or the shortest the coolest, go to answers to Ask Jack questions about the seasons.