Cooked potatoes should not be left unrefrigerated as it is not safe and can cause food poisoning due to the bacteria that can grow rapidly on the cooked potatoes.
Cooked potatoes and other foods with starch in them are able to grow bacteria and other germs rapidly when left out at room temperature unless kept at a temperature of 140 F or above until served.
So if you're not gonna eat the potatoes within a few hours you should refrigerate the cooked potatoes or freeze them to prevent bacteria and germs from growing on the cooked potatoes.
Or keep the cooked potatoes at a high enough temperature to keep the potatoes from growing bacteria or germs.
You can easily become sick with food poisoning if leaving cooked potatoes out overnight and then eating them the next day so always refrigerate them or freeze them to keep the bacteria away from the cooked potatoes.