Let's say we program an arduino uno or nano and then stop using it for a while. How long can we expect the program to last on the arduino?
More than 20 years, and probably more than 100 years.
That's the guaranteed minimum:
Data retention: 20 years at 85°C/100 years at 25°C(1)
(1) Reliability Qualification results show that the projected data retention failure rate is much less than 1 PPM over 20 years at 85°C or 100 years at 25°C.