The actual answer is "Maybe"
Sometimes this works, sometimes it doesn't
Will it boot? Often, no. And a main factor in yes or no is how far apart the two systems are.
Licensing? What type of license is it? An OEM license is tied to that original motherboard. A retail license can be installed on a new system.
So...what is the way forward with this?
1. Discover what type of license you have. If it was preinstalled on that old PC, almost certainly an OEM license.
2. Prepare for if it does not work. If you swap the drive around, and it does not boot...you'll be left with one thing to do - Reinstall. If you have not prepared for this, tears will follow.
Find the license key, back up whatever you want from that drive, be prepared to reinstall all your applications, etc, etc.