In order to activate a new version of Windows you need a
product key like this:
So, YES, you have to buy Windows 10, basically you pay the product key. You can and should buy it directly from Microsoft official website.
Windows 7 will only receive updates until next year: