A CPU, or Central Processing Unit, is generally described as the brains of the computer.
It handles all of the different hardware in a PC, and is where each instruction is executed.
As such, it is extremely important for performing day to day tasks.
However, as I'll mention later, is not the most important part of a *Gaming PC*.
A CPU's fundamental job is to execute a series of instructions, commonly refered to as a program. The general cycle most CPUs follow is that of Fetch, Decode, Execute. At the start of each cycle, the CPU will fetch the next instruction that is needed to be executed, it will then decode what the instruction wants, and will finally execute the instruction. There are plenty of other things in the CPU, such as busses and registers, however these will generally not matter for pure gaming performance!
There are many places where you can buy a CPU, however, buying directly from Intel or AMD will not be an option for you. In this case, you can go through retailers such as Amazon, ebay and other tech sites to buy the CPUs yourself. Here are a few sites I recommend.