How long do you need to power an ssd up for to maintain the data on it, and is it the OS or the drive that maintains it? [migrated]

So I have an Samsung 240gb 840 EVO that I upgraded to an 500gb 860 EVO, I want to keep the old one as a backup (So i can swap it back in if the new one fails (it is the Operating system drive)). I am a bit late to this as I actually replaced it about a year and half ago (so the old SSD has now been sat on the shelf for about 1 and a bit years) and have just bought an external usb enclosure for it. Currently doing an error check on it (the 840 evo). (Ok it said it would take 3 hours , it lied it took about 10-15mins) and came back saying no errors. Which is nice but surprised me !

I have heard that leaving it on the shelf too long will corrupt the data, so I figure I can stop this by plugging it in every so often.

So the question is if I plug it in say every month or 2 to keep it refreshed, how long do I need to leave it on for ? Is it like 2 seconds or a couple of hours ? Is there something built into the SSD controller itself to keep the data topped up, or is it done by the operating system (win 10)? And if it is windows itself topping it up is being externally mounted on the USB ok, or does it need to be plugged directly into the SATA ?

Also what is the top up mechanism, is it there is some kind of capacitor or battery in the SSD that needs topping or does it go around and re write all the data or is it that it doesn’t top it up and leaving it unpowered is a cumulative thing that eventually destroys the data even if you keep plugging it in every so often?