The ground routinely starts to cool after the sun sets because it emits more radiation than it gains from the atmosphere. In other words, the temperature of the ground starts to lower because it runs a radiation deficit (more losses than gains).