You can use the installation with new hardware, but you have to take care of the drivers as Sean mentioned. You can use a tool called sysprep to prepare the OS to accept new hardware.
When you are ready to move the drive to your new computer, press Win+R to open the run window, type "sysprep", and press enter.
Keep "Enter System Out-of-Box Experience (OOBE)" in the first drop-down, tick the "Generalize" checkbox, and change the second drop-down to "Shutdown".
When you start the new computer and boot to the drive, Windows will detect new hardware and use appropriate drivers.
Licensing is another matter. Assuming you used an OEM Windows 7 key, it is bound to the motherboard when activated. You can try to get Microsoft to let you activate again, but I've never done this and I'm not sure what to expect with 7 being so old. The easy answer is that the motherboard change will invalidate your license and you need a new one.
If you have a retail copy of 7, you should be able to activate again on the new board.