Mashed potatoes will last in the fridge for up to 4 days before they go bad.
After 4 days the mashed potatoes will go bad because bacteria will grow on them and mold will start to grow as well so in that case the mashed potatoes should be thrown out.
When storing mashed potatoes in the refrigerator it's best to place the mashed potatoes in a sealed airtight container and then refrigerate it.
The sealed container will also keep other food smells and odors off the mashed potatoes and you should eat the refrigerated mashed potatoes within 3 to 4 days.
You could freeze the mashed potatoes in a freezer safe container and they will last up to 6 months but the frozen mashed potatoes when thawed won't be as good as the potatoes that were refrigerated.