Effort values
Effort values, or EVs, are a big part of Pokémon training, as much as leveling up. Effort values are experience points for Pokémon stats. Each Pokémon gives a different amount of effort points to each stat, and the more effort points a Pokémon gets for a certain stat, the higher the EV, raising that stat more the next level.
For every 4 effort points in a particular stat, the Pokémon will gain 1 more point at level 100 than it normally would have. These extra stat points are earned gradually as it levels up. There is a limit to EV gains introduced in Generation III. Pokémon can gain a maximum of 510 EVs in total, and no stat can have individually more than 255. This allows for the "maxing out" of 2 stats, which really means that the Pokémon can gain a maximum of 63 points (252/4) in one stat. EV training doesn't have to stop upon reaching level 100, at least in pre-Generation III games; as players can use the box trick. The Pokémon's stats will be recalculated upon deposit to the PC to reflect the gain in EVs.
Most Pokémon give only one EV in a particular stat, but most of the stage 1 and 2 Pokémon and legendary or rare Pokémon give up to 3 effort points in one stat, or multiple points for multiple stats.
For a list of Pokémon with the EV's they give in battle, see List of Pokémon by effort value yield.
Additional Factors
Vitamins like Carbos, Calcium, and Iron add 10 effort points to a particular stat, provided the EV is less than 100.
Macho Brace, an equip-item introduced in Generation III, decreases the holder's speed in battle, but doubles the amount of effort points the Pokémon holding it gains in battle. For example, if a player's Pokémon were battling a Rattata, which gives one Speed effort point, upon defeating the Rattata the player's Pokémon would receive 2 Speed effort points instead of 1.
Exp. Share, other than sharing Exp. Points, also gives the same amount of EV's to the Pokémon holding it that the Pokémon battling receives.
The rare virus PokéRus also doubles the amount of EVs given to Pokémon afflicted as well as Pokémon that have developed resistance to it.
Certain berries, when used in Emerald, Diamond, and Pearl decrease EVs by 10 while increasing happiness by 5.
In Diamond and Pearl, a series of items can be obtained that raise the EVs gained for just one stat. These items all lower the holder's speed in battle, but each item respectively add 4 EV's to the amount EV's gained for their corresponding stat per pokémon defeated, effectively adding one point to that stat for each pokémon defeated: Power Anklet (Speed), Power Band (Special Defense), Power Belt (Defense), Power Brace (Attack), Power Lens (Special Attack), and Power Weight (HP).