Assuming that Windows 7 came pre-installed with your old PC (and is therefore almost certainly an OEM version), the answer is no. The installed operating system is tied to the hardware. In any event, it probably wouldn't work due to driver issues.
If you have a full retail version of Win7 (very typically purchased independently from the hardware), then it can be transferred to another PC (by installing from DVD, not by swapping the hard disks).
However, if your old PC came with the OEM version pre-installed, it probably has a CoA sticker on the (back of the) case somewhere. In which case you may well be able to install Win7 from scratch on the hardware using the product key from the CoA sticker (but you will need a Win7 DVD [Home or Pro as appropriate). It is quite normal for original OEM installs to use a "volume licence key" plus supply a separate discreet product key on the CoA.