A dead body can cool to ambient or room temperature within minutes to hours depending on the temperature it was while still alive as well as the physical environment. According to Healthline, the cooling of corpses is not as predictable as physicians once believed, making it a less valuable indicator of time of death than originally thought.
ExploreForensics explains the average dead body continues to generate some heat for a short time after death. This period lasts from two to six hours and is known as the "temperature plateau." Following this period the average corpse loses heat at about 1.5 degrees per hour until it reaches the temperature of its environment. However, other factors affect this rate, including the type of clothing the corpse is wearing, the amount of body fat it contains and the amount of blood loss that the body experienced. Additionally, a body that has been found outside or in cold water is likely to cool much more quickly than one found in a heated environment, and conversely, a body found in a warm environment is likely to cool more slowly.
Healthline reports that in 1710, English medical doctor John Davey was the first to use a thermometer, a relatively new invention at the time, while performing an autopsy.