Cpu and op

Im new to computers and Im wondering if I put windows seven on a computer then replace the cpu with some thing better do I have to put windows seven back on?

Nope, not for the CPU. I'm assuming you're saying you have a retail license of Windows (you bought your windows key) rather than an OEM key where Windows came installed on a computer you bought prebuilt.  The only time you might need to purchase a new Windows License key is if you replace the motherboard and you have an OEM license.  This is because OEM license keys are tied to the first motherboard they're installed on.  Microsoft will sometimes be nice and reactivate your license anyway, but they're under no obligation to do so as per the license agreement.

Thank you for the help

This, I just wanted to add that I have transferred my windows license (well several different licenses)  to a new motherboard twice and Microsoft didn't give me any grief about it. I just followed the automated process and received a new key each time