Just like a pot of water doesn't boil the instant you turn on the heat, the atmosphere takes some time to warm up or cool down, as the case may be. Even though we get the most daylight in late June, it takes about 30 days for the atmosphere to transfer that maximum warmth to the surface. The same, but opposite effect works in winter.
The oceans and lakes take even longer to respond to heating and cooling. They typically take until late September to be at their warmest, and late March to be at their coldest.