If you upgrade from Windows 8.1, you will not loose your personal files, nor will you loose your installed programs (unless some of them aren't compatible with Windows 10) and your Windows settings.
Will I lose all my photos, documents in word if I upgrade to Windows 10 Pro? Any attempts to reinstall on the same computer or transfer the product will be left to Microsoft's discretion. This is a single use OEM/OEI license, and is intended to live and die on the initial computer on which it is installed.