Cooked potatoes are safe to eat the next day as leftovers as long as you store the cooked potatoes in a sealed container and refrigerate the leftover potatoes.
You can also store the cooked potatoes in a plastic bag in the refrigerator and the cooked potatoes will last up to 5 to 7 days before going bad.
If you want to keep the cooked potatoes longer than 5 days it's recommended to freeze them instead.
When frozen the cooked potatoes will last 6 months to a year or even sometimes longer but they will lose their freshness the longer you keep the cooked potatoes.
I always save leftover cooked potatoes when I cook too many of them and just store them in a plastic container that has a sealed lid.
I then put them in the refrigerator and usually eat the cooked potatoes within a few days but if not I move them to the freezer.