Well, you have a couple options. If you had a previous PC with Windows 7 installed on it, then you're allowed to download that same version of Windows 7 as a backup. Just make sure you have a Microsoft Windows 7 key (if you have another prebuilt PC with Win 7 then you can likely find the key as a sticker on the bottom of a laptop; not sure where on a desktop) or else you'll only have a trial period for windows before some of its features just stop working. Here you can find a backup .iso file for I believe every version of Windows 7:
http://www.w7forums.com/official-windows-7-sp1-iso-image-downloads-t12325.html
It's completely legal, assuming you have the key. However, if you don't have a previous PC with Win 7 on it then it's illegal and I believe we're not allowed to discuss such things on this forum. However if you need an alternative, go with Linux. Completely free, and very nice to use.
If you need help with the actual installation of Windows 7, let me know.