Leftover rice should be put in an airtight container in the fridge immediately for the aforementioned reasons. The cold temperature won't kill bacteria that may/may not be present, but it does slow its growth significantly. Stir fried rice is actually better with leftover rice than fresh, which is often too moist and clumpy for that application. If you don't want to stir fry, reheat in the microwave or stovetop with added water. The water will rehydrate the rice, though of course it won't be quite as good as fresh rice.
I've heard fridge rice can last for 3 days, but for caution's sake I throw it out if I don't use it the very next day.
My personal cutoff for other foods is 5 days. Most things are still edible by that point, but the taste and texture can often suffer. Workarounds for that include re-purposing the dish into a new recipe, or generous applications of acid (citrus, vinegar, and especially hot sauce), olive oil or butter, and herbs to reinvigorate it.
Always do the smell test first and always taste a little morsel after that just to make sure it's something you still want to eat.