If it's the HP preinstalled OS then you'd have to buy a license for the same version to activate it on a new motherboard, and you wouldn't want it anyway since HP has the worst load of bloatware in the industry which throttles Windows 7. You'd want to Clean Install Windows 7
If you have a retail version installed then you can move it anywhere you want as often as you please. However if it's an Upgrade it requires having a qualifying XP or Vista retail copy on hand though it doesn't have to be installed. If upgrade key is rejected during install, leave it blank and then afterwards do the quick Option 3 workaround given in Clean Install with a Upgrade Windows 7 Version
to activate Upgrade version on a new or wiped HD.