Such first foods are considered bad for consumption usually after 2 to 4 hours depending on several factors such as, room temperature. However, if refrigerated, it can last for about 3 to 5 days. The duration is also determined by the kind of cooking; for instance, ham that is fully cooked lasts longer than that which is half cooked.
No more than 30 minutes. The temperature range at which food goes bad is above 40 and below 120 Fahrenheit, so room temp is right in the middle of the dangerous range. And trust me, you DON'T want food poisoning, it sucks!