Ideally you should buy those apps you use to support the developer's efforts. Still, if you search through the forum you'll find some suggestions on saving or moving apps. Some of those suggestions will say don't format & reinstall Windows -- fix the Windows you've got instead. Laplink sells an app designed to move your installed software to another PC, though I've no idea how well, or if it works. Keeping records can help...
As Dragonlair pointed out, sometimes the registration or activation data's stored in the registry, & sometimes everything the app or game needs to work is in the app's or game's folder. Sometimes that data's stored in Windows User folders/files, & sometimes it's kept in the Windows' folder itself. Some developers are more generous as well.
Paragon & Ashampoo store your program keys in their on-line database for example, so as long as you save the original setup program you can re-install whenever. Some developers provide keys that work with their regular trial downloads, sometimes for a set period of time, some until a new version is released.
Do note that it's becoming increasingly common for software keys &/or activation to be dependent on some hardware ID, e.g. the number for your system hard drive. A hard drive will have one embedded #, plus one assigned to partitions when created & formatted [the volume serial number]. It's not a bad idea to check that sort of thing out *before* you make changes, whether formatting & re-installing Windows or replacing a drive or even something like changing from IDE to AHCI -- licensed software may no longer work, & it may take weeks worth of hassles contacting the software company to try & get things fixed. Adobe's bad about that but you're supposed to know to deactivate your installed copy ahead of time, reactivate after you're done. One simple precaution you can take is to write down the existing volume serial number for the drive(s)/partition(s) -- from a command prompt at the root of the partition, e.g. C:\ , just type dir & press the Enter key. Sysinternals [microsoft.com] makes one of several free apps to change that volume number to whatever you want, like the serial number that partition had when you activated your software, sometimes avoiding a lot of hassle.