Since 2015 you could legally upgrade from Windows 7 or Windows 8 to Windows 10 for free. Microsoft first announced this as a one year offer but still activated any installation of Windows 10 using a legitimate Windows 7 or 8 product key up until last week.
You can still purchase a Windows 10 licence if you’d like to upgrade your old Windows 7 or 8 machine. I would recommend it if your hardware is still going strong – it is much more secure than the out of support operating systems. But I guess if you’ve made it this far, you probably keep yourself fairly safe online.