Theoritically a magnet will have its magnetic property Forever. This happens because if you keep a magnet without opposing it's magnetic force and at a temperature of 0K then it will retain its magnetic force field forever. But when we consider a magnet to be kept in a temperature more than 0K then the constant movement of the particles (kinetic energy due to heat )will slowly disorganizes the magnetic domains. After losing its magnetic field the magnetic domains will align themselves to an existing surrounding magnetic field (Mostly earths magnetic field) and again gain their magnetism.