Put simply:
Effort Values
Whenever one of your Pokemon KO's another Pokemon in battle and receives EXP from the fight, you will also receive a certain number of Effort Values (EVs) from the fight. The EVs you receive depend on what species of Pokemon you fought - if you defeated a Machop, you'd receive 1 Attack EV, whereas defeating a Geodude would earn you 1 Defense EV. Some Pokemon give more than 1 EV when defeated; Machoke for instance gives 2 Attack EVs, and Infernape gives 1 EV in Attack, 1 EV in Sp.Attack and 1 EV in Speed.
In order to train a Pokemon to its maximum potential, EVs must be taken into account. The maximum amount of EVs you can have on one stat is 255, and you can have 510 EVs altogether. At lv 100, 4 EVs in a particular stat will increase that stat by 1, so by focusing on only getting specific EVs for your Pokemon, you can make them a lot stronger. A basic example is Rampardos - Rampardos is best as a Physical Sweeper with its massive Attack stat, but its Defenses and Speed are poor. So, you'd put 252 EVs (not 255 since the extra 3 would go to waste) on its Attack stat, and the other 252 probably onto Speed since Rampardos is primarily offense oriented. The other 6 can go anywhere for an extra 1 on a given stat, although 2 of those EVs will go to waste regardless.
Individual Values
These values are determined the instant a Pokemon is hatched from an egg or encountered in the wild. One thing to note is that these values cannot be changed, ever. Each stat has its own IV, ranging from 0 to 31. The higher the IV, the higher the respective stat will be. The IVs are chosen completely at random for the most part, and one IV's resultant value will not affect any of the others - one Pokemon could have 31 IVs in all of its stats if you were lucky, or even 0 IVs in all stats if you were especially unfortunate. Generally, you want to aim for high IVs in the stats you focus on putting EVs into; in the example I used earlier, Rampardos would want as close to 31 IVs as possible in Attack and Speed, although high IVs in the other stats as well would be a welcome bonus.
The only real way to control what IVs your Pokemon have are with breeding - when a Pokemon is hatched, it has 3 random IVs as well as 3 taken from the parents. If one of Rampardos's parents had a 31 IV in Attack for instance, there's a chance that the baby Cranidos would have a 31 IV in Attack as well.
That basically sums it up. If you have any other questions, don't hesitate to ask.