Per the USDA guidelines, Potentiallypotentially hazardous food that stays in the temperature "danger zone", 40-140 °F (4-60 °C), for more than 2 hours should be discarded. For temperatures above 90°F (32°C), the limit is 1 hour.*
Potentially hazardous foods are those foods that spoil most easily, such as unshelled eggs, raw meats, fish, shell fish, dairy products, almost all cooked foods.
This time is cumulative, so it includes time bringing the food home from the grocery store, time before cooking, time after cooking, and so on. The reason is that while cooking may destroy bacteria or other pathogens, it doesn't always destroy the toxins that they have produced.
So inIn general, regarding perishable foods like meat, most dairy, unshelled eggs and shell eggs (in the US), cooked casseroles, and so on: if the food (or its perishable components) have been at room temperature for more than two hours, you should discard that food.
To avoid the danger zone, keep cooked food hot until ready to eat, then refrigerate immediately. Separate large items into smaller containers to help them to cool more quickly. If you’re defrosting something, do it in the fridge or under cold running water.
If you can be certain that the food was not in the danger zone, then yes, it is safe. For example, if you left a large chunk of frozen meat out and it is still frozen solid (including the surface) when you come back to it, it was not in the danger zone.
Why is it so strict? / Why didn't I get sick?
##Why does cookingThese guidelines are about making sure you don't get a foodborne illness, i.e. reducing the risk to where it's so small as to not completely "resetbe an issue. So if you break the clock"?rules, e.g. eating food that's been left at room temperature for 8 hours, that doesn't mean you will get sick, just that you're taking a risk.
Why does cooking not completely "reset the clock"?
* Note: this is the FDA'sUSDA's rule. Other agencies may have variations on it. Additionally, government agencies generally make very conservative recommendations - they're trying to make sure that no one who follows the rules gets sick. Breaking the rules means maybe taking on some risk. That's up to you - just remember, eventually someone gets unlucky, and food poisoning is not fun.