Cooked food sitting at room temperature is in what the USDA calls the "Danger Zone," which is between 40°F and 140°F. In this range of temperatures, bacteria grows rapidly and the food can become unsafe to eat, so it should only be left out no more than two hours.
Well, the technical rule of thumb would be that if it is raw, it has about a good 2-3 days before it goes bad. If it's cooked, it has about 3-4 days before it spoils. If they are leftovers, you have, at the latest, a total of 4 days before they aren't "safe" to eat anymore. Hope this helps!