Windows 10 will be available for free if you have Windows 7, Windows 8.1 or Windows Phone 8.1. But you have to upgrade in the first year after the launch of Windows 10. Terry Myerson, Microsoft's Executive Vice President of Windows, said today that "This is more than a one-time upgrade: once a Windows device is upgraded to Windows 10, we will continue to keep it current for the supported lifetime of the device - at no additional charge."
Source: Windows.com