The replies above only address half of your issues. It is quite true that, with the computer power turned OFF you can install your old HDD as a second drive. Do not do this with the power on like a "hot swap"! When you boot up the computer should boot properly into Win 8.1 And as suggested, you should check in BIOS Setup to make sure that the (newly installed) old HDD is NOT in the boot device priority list. The old HDD will appear in My Computer and you will be able to access all your old data files.
Now, the rest of it is: you said you want to do this because the old HDD has "some programs I want to move over to my computer". Programs (application software) is not so simple. In all recent Windows versions, software must be Installed to be able to use it. The Install process for each software package places information in the Windows Registry telling it where the software is and how to set it up and run. Your problem is that any old software installed on the old HDD under Win 7 is completely unknown to the Win 8.1 Registry. To use the old software suites, you will need to re-Install each of them so that the current Registry (for Win 8.1 on the newer HDD) gets the required information added to it.