It will boot, but probably won't run as fast as it should (if it's a gaming pc).
You do need to login to your Windows account and register your current installation to your account.
Then change the hardware over and boot.
Windows is normally clever enough to automatically reconfigure itself. But you may get an error saying Windows isn't registered, this can be sorted by telling Windows you have gone through a hardware change.
I did something similar, moving from an Intel system to Ryzen. Cpu, motherboard and memory change.
I purposely kept the windows installation so the current registered install would 'see' it was 'me' booting with new hardware. All went smoothly, windows then stored my new hardware configuration to my account, then I did a full wipe and reinstall, again all went smoothly.
You might not have this option if its a hardware failure that's forced you to change motherboard etc.