Once cooked, potatoes can be subject to the growth and proliferation of microorganisms, pathogenic as well.
Therefore when handling boiled or cooked potatoes you must respect the same hygienic rules you follow for any other food: you should place them straight in the fridge and never keep them at room temperature. Anyway, leftover potatoes have a very poor taste.
When potatoes are exposed to light, they produce solanine, a high toxic substance, under the peel, and they turn green. Therefore, potatoes with green spots on their skin must be discarded.