I'm pretty sure that with Windows 7 if there are any significant hardware changes it just asks your for your key again. Not sure though.
I've also heard that if there are any hardware changes on Windows 10 you will have to purchase a key, so I'd recommend upgrading before swapping out your motherboard.