If the magnet doesn’t break or shatter, it should remain functional for many years. The magnet is unlikely to lose its effectiveness for a very long time, so unless your fridge magnet falls and breaks, it should stay in place for years to come.