Several factors. Does it have a useby date? If so, if it is past it, do NOT use it. If you're less cautious or if it does not have a useby date, does it look discoloured or smell funny? If so, do NOT use it.
whipped cream can last as long as the expiration date says that it can last. whipped cream on cookies, that would not last that long, the whipped cream would being to lookse its fluff and its taste.
Purchased tomato sauce should be stored in a cool, dry place. When referring to homemade tomato sauce, how it is stored depends on how long one wants to keep it. # Use clean, sanitized containers. # Keep it covered (limits mold exposure). # Cool it quickly and thoroughly. Use shallow containers and refrigerate or use an ice bath. # Refrigerate at 40°F or below. Use within a week. Check for signs of spoilage before use. Reheat completely. For longer storage, put it in the freezer.
Mold growth on soft cheese is not considered safe to eat, unless it is intended to be there - as in brie. For hard cheeses - like cheddar and Swiss - conventional wisdom has said that cutting out the cheese within one inch of the visible mold will make the rest of the cheese edible.