This one is the mostly complicated to explain, but it's really not that bad once you get a feel for it. Some math skill will help, too.
EVs, or Effort Values, are another hidden stat that indicate the Pokemon's training. Defeating enemy Pokemon, eating Vitamins, going through Super Training... these are all ways to gain EVs.
You have much more control of EVs than IVs, but there are limitations upon them. Most notably, Pokemon are limited to 252 EVs (in this generation) per stat, and 510 EVs across all six.
The limit per stat used to be 255, but was changed to 252 in this generation. A 255-EV Pokemon that gets Transported will have its EV reduced to 252.
EVs only matter in groups of 4 (which is why the per-stat limit was reduced; 255 EVs meant three were wasted). At level 100, ignoring skewing by Nature, each set of four EVs applied to the same stat adds 1 to the stat. The maximum of 252 EVs comes to 63 stat points, and 510 EVs all around means 127 are available between all six of your stats (and two EVs are useless, which can be considered insurance from screwing up slightly). Again, lower levels scale this and nature skews it.
510 EVs allows for two stats to be maxed and a third stat to receive four more useful EVs, but this is not the only way they can be distributed.
How do you get EVs through battle?
Each Pokemon species grants between 1 and 3 EVs when defeated. Everything that gets EXP also gets EVs in full, including when the EXP share is active, when the Pokemon was fighting the enemy but switched out, and when the Pokemon is captured (in the sixth gen), but not when the Pokemon is knocked out. EVs are not split; everything that can get them gets all of them. The level of the defeated Pokemon doesn't matter, only its species.
Most Pokemon give EVs in the stats they excel in. Weak and unevolved Pokemon typically give 1 EV, moderately strong Pokemon and those that have evolved once usually give 2, and legendary Pokemon and those that have evolved twice generally give 3. For a list of what Pokemon give which EVs, I again point you to fansites like Serebii and Bulbapedia.
If your Pokemon already has max EVs in the relevant stats or total, then nothing will change; no EVs will be lost and none will be added.
Any way to get them faster?
There's a rare status called Pokerus, which spreads from Pokemon to Pokemon in your active party as you battle if any of them have it. It wears off after a few days in the active party, but this only means it cannot be spread. Pokemon that have ever had Pokerus - even if it has worn off - receive double EVs from battle.
There are also items that affect EV gains. The Macho Brace doubles them; the Power items (Weight, Bracer, Belt, etc.) automatically add four EVs to the stat that matches them with every Pokemon defeated in addition to the EVs the Pokemon normally gives. Both of these stack with Pokerus, meaning it is theoretically possible to get 14 EVs from a single Pokemon (if the Pokemon gives 3 EVs, your Pokemon is holding a Power item, and it has Pokerus: (3 + 4) * 2 = 14.)
Hordes are a very powerful EV-training tool, if you have Pokerus and a Power item. A horde of 1-EV Pokemon will give 50 EVs to a Pokemon with both, and a horde of 2-EV Pokemon will grant 60! (There are no 3-EV Pokemon hordes, but if they existed, they'd grant a whopping 70 EVs.)
Though multiple Pokemon can get EVs from a single opponent, only the ones that actually have Pokerus or the boosting items get any effect from them. That said, it doesn't matter if the Pokemon is actively doing the fighting or just sitting back and absorbing the EVs through the EXP Share; the boosts still affect it when it has them.
What are some good places to fight hordes for particular stats?
Remember to use Sweet Scent or Honey to attract hordes... and that you can't attract them if it's raining on the overworld. I'm compiling information from Smogon for this.
HP: Route 5 (Gulpin - 1), Connecting Cave (Whismur - 1), Route 20 (Foongus - 1)
Attack: Route 19 (Weepinbell - 2 and Arbok - 2), Route 14 (Bellsprout - 1 and Ekans - 1)
Defense: Terminus Cave (Durant - 2, Geodude - 1, and, in X, Aron - 1), Victory Road (Geodude - 1 and, in some caves, Graveler - 2)
Special Attack: Frost Cavern (Vanillite - 1 and Smoochum - 1)
Special Defense: Reflection Cave (Mime Jr. - 1)
Speed: Route 8 (Wingull - 1 and Taillow - 1), Route 12 (Wingull - 1), Route 15 (Murkrow - 1)
What if I don't like the way my EVs are arranged? Can I remove them?
First of all, one of the punching bags you can get from Super Training is a solid-white Reset Bag. Any Pokemon that punches this will have all of their EVs sent back down to zero.
You can do the same thing by mixing a Perilous Soup at the Juice Shoppe. This requires one Kee and one Maranga Berry.
If you just want to fine tune them a little, there are certain berries that reduce an EV by 10. These berries are:
Special Attack: Hondew
Special Defense: Grepa
Removing your EVs will also lower your stats, so you can't abuse the system. But it lets you retry a bad spread.
EVs never disappear from your Pokemon unless you do one of the above; they are otherwise permanent. Gaining levels, evolving, trading; none of this affects EVs.
How can you check how many EVs you have?
Super Training has a hexagon-shaped chart that will give you a rough idea. The yellow region represents your EVs. Too vague? You can do better.
Save first. Did I mention save? You'll be sorry if you don't! So, now that you've completely saved...
Punch a Reset Bag.
This removes all EVs from a Pokemon, and as it does so it will show exactly how those EVs are changing on the hexagon grid. So if you see see a -120 next to a stat, that means your Pokemon had 120 EVs in that stat.
And now doesn't any more, so unless you really wanted to remove the EVs, you'd better reset!
How do I know which stats I should train in?
It's completely up to you! Sites like Smogon give suggested EV builds, but you don't have to follow them. I'll just say this: most people train offensive Pokemon in Speed and the Attack stat they use, while defensive Pokemon usually get HP and the lower Defense boosted, unless its HP is high enough relative to the defenses. But I have no gun to your head. Experiment!
When should I start training the Pokemon? At level 1?
Doesn't matter. But if the Pokemon has seen battle already, it may have EVs you don't want, so you'll want to erase those first.
How many EVs should I get per level?
Doesn't matter. EVs are not given on a per-level basis. EVs are EVs and levels are levels.
Are EVs why Rare Candies are bad?
Rare Candies are not bad. There is no negative side effect to using Rare Candies.
So if I get 4 EVs, that means I'll get 1 point of stat gain when I level up?
No, that's not how it works. There is no such thing as "stat gain" in Pokemon, at least not of the Fire Emblem sort. The Little Plus Numbers (LPNs) you see when you level up don't mean anything of value and can be safely ignored.
And that's not dodging the question. It's not at all impossible to receive a +0 LPN in a stat you've been training, especially in the later generations where EVs are applied to your stats immediately after you get them.
I trained up to 252 EVs in Super Training, but my level 20 Pokemon barely has 63 in its stat at all, let alone from EVs! What gives?
The 63 point boost from having 252 EVs kicks in only at level 100. At level 20, you'll only get 12 or 13 points in a Nature-neutral stat from 252 EVs. Don't worry, those EVs will still be in all their 63-point glory there once you've hit level 100!
Can I gain EVs at level 100?
You can't through battle in the third or fourth generations. In any other generation (including, sort of, the first two, though the system was quite different then), yes, you can EV train through any method at level 100.
Sorry for copying straight off from a gamefaqs post ^-^ Source