Food scientist Susan Brewer offers the following advice: the amount of time which leftovers are safe and/or of good quality depends on the leftovers.

Mixed dishes which contain (cooked) animal products (such as meat, milk, and eggs) tend to have the shortest shelf life both for quality and safety reasons. They may have originally had pathogenic bacteria associated with them. If cooking didn’t kill every single one, the bacteria can grow (slowly), making the product unsafe. Three days is the standard length of time recommended for these products.

Raw leftover vegetables also tend to have short shelf lives but for quality reasons. Raw vegetables dehydrate and get limp (for example, salads).

Cooked vegetables tend to have longer shelf lives as the bacteria should have been killed. Quality deteriorates more rapidly in some cooked vegetables (such as asparagus and broccoli) than in others (such as carrots and sweet potatoes). Baked beans tend to have a longer shelf life because they don’t contain nearly as much water. If covered and properly refrigerated, they will last a week or longer.

Cooked vegetables should be placed in covered containers with some airspace. Air prevents the germination of botulism spores (which requires air). These spores are not killed by boiling (212°F) temperatures. (They require 240°F for a period of time related to the size of the container they are in). The fact that there is air present will allow mold growth, but, if the leftovers are properly refrigerated, they should keep for several days. How long they keep depends on the vegetable, what else was in the product, and the “available” water (water not tied up with solutes like salt, sugar).