Yes, overclocking your Intel CPU (not sure about AMD but it should be the same) will void the warranty. Intel doesn't "support" overclocking, however they ALLOW you to do it on their unlocked CPUs. But in all honesty, you REALLY don't need the warranty. It's either the CPU works or it doesn't. If the PC turns on, you have a good CPU and you should overclock it. Now, there's really 4 types of overclocks you can do to your CPU. First, there is a mild overclock. It's just increasing the clock as much as you can until it's stable without touching the voltage. This doesn't affect the CPU lifetime at all as long as your temps are decent. For Intel 3rd and 4th gen CPUs, under 90c is safe at stock voltage, but you should hit a max of about 70c using stock cooler. The second type is a moderate overclock. You set a yourself a reasonable clockspeed which is about 4.4-4.5GHz on 3rd and 4th gen CPUs and increase the voltage until it's stable. You may want to get a cheap but good CPU heatsink, such as the famous Hyper212+ or Evo. (Get the 212 Evo, not the +... 5c cooler for 5$ is worth it) You will probably achieve 4.5GHz at about 1.3v, usually less. That won't really affect your lifetime a noticeable amount as long as you keep your temperatures under about 85c for 3rd and 4th gen CPUs. The less voltage you have, the higher your safe temperature/lifetime is. The third type is an aggressive overclock. This is pushing your CPU to or almost to it's limits with high end cooling. For example, me. I have a Intel 3770k and I run mine at 4.8GHz at 1.48V with an H80i. Normally this wouldn't be achievable/safe at such high voltage. However, I delidded my CPU which lowers temperatures by up to 30c (which is a MASSIVE improvement) if done perfectly. You can read more about that here:
http://www.overclock.net/t/1313179/official-delidded-club-guide . I would highly recommend doing this if you want to get into aggressive overclocking and have a bit of experience. Do the hammer/wood/vice method if you do. It's a LOT faster and MUCH safer. I've done both. In a agressive overclock such as mine, You should keep your temps below 80-85c and you will NEED to invest in a high end cooler. The fourth is extreme overclocking, which is using Liquid Nitrogen or similar sub-zero liquids such as liquid Helium to cool the processor so it can safely achieve extreme voltages which allows it to achieve extreme clockspeeds.
Coming from a very experienced agressive overclocker, I say AT LEAST do a mild overclock, however I recommend spending 35$ on a Hyper 212 evo and some MX-4 thermal paste and some time to achieve a moderate overclock. Then maybe later on when you have some experience and enjoy overclocking, you may want to invest in aggressive overclocking, which unfortunately will cost you 80-120$. With a mild overclock, expect 7+ years. With a moderate overclock, expect your CPU to last about 7 years. With an agressive overclock, expect around 5 depending on your voltage and temps. Hope this helps you and I hope you get into and enjoy overclocking!