How long will my fridge magnet stay attached to my fridge? I have a 500 gram neodymium magnet. It is stuck to my fridge. With the constant pull of gravity trying to pull it off how long would it stay attached to fridge? For arguments sake lets say my fridge is very sturdy and will never need to be replaced!
If my fridge was very sturdy would it still be attached when the earth was swollowed up by the sun in its red giant phase?
 A: 
Constant pull of gravity

There's a "constant frictional force" as well. In fact, the magnet stays stuck due to friction, not directly magnetic force. The magnetic force will exert a normal force $N$ on the fridge (and vice versa by action reaction). The fridge will exert an upwards static frictional force $\leq \mu_sN$, where $\mu_s$ is the coefficient of static friction for the magnet-fridge interface. $\mu_s$ should be large enough so that $\mu_sN\geq mg$, so the frictional force will be sufficient to keep the magnet steady.
Now let's talk about it falling off. There are two ways this can happen: Either $\mu_s$ reduces due to smoothing of the surface, or $N$ reduces due to demagnetization. Demagnetization can slowly happen whenever the magnet undergoes some change, like rusting, being heated, or being jarred. It can also happen if the magnetic field in the area abruptly changes. In this case, the abrupt change is the one that happens in the Earth's magnetic field, but before that happens, the magnet will most probably have rusted or flaked off. I had a normal (iron) magnet which became extremely weak after ten-ish years. So most probably your fridge magnet will fall off before the Earth gets swallowed up. I'd give it a few decades, since it's a neodymium magnet and it's not really exposed to the air.
A: Over time the magnetisation will degrade due to ambient temperature (the spins will start to randomly realign). When this has happened sufficently then the Earths graviational field will be able to pull the magnet off. At $0\rm{K}$ then the magnet will never fall off. In the very long term the Earth will warm up as the Sun expands the surface temperatuce will get to hundreds of degrees, demagnetising the magnet, long before the Earth gets swallowed up though. The real answer is somewhere in the middle, I'd have said a couple of centuries maybe although it depends on how well magnetised the magnet was to start with so an accurate answer is not really possible.
