My mother always used to tell me to make sure that food was cooled before putting it in the fridge but apparently this is just a myth.
According to the Food and Drug Administration, leftover food (particularly meat) should be refrigerated immediately after serving, and certainly within two hours of cooking.
Food bacteria can double every 30 to 40 minutes, and several outbreaks of food poisoning have been linked to meat cooked and left to cool at room temperature for too long.
Generally, the bacteria that contaminate food thrive at temperatures between 40 degrees and 140 degrees, so leftovers should always be stored in a refrigerator set at 40 degrees or below.
When the quantity of food is large, it should be separated into small containers for quicker cooling, and reheated no more than once.
Basically, try to put things in the fridge as soon as possible.