This is the trick to creating a Pokémon that will be as strong as it can be!
The first thing to do when creating your super-pokémon is to catch many of the same type/level, and choosing the one with the highest starting stats.  In the screenshot on the left are six level 20 Pikachus, all with different HP.
Now look at the six Pikachus again, after five Rare Candies have been used on each of them.  Notice how the one that originally had 48 HP now has 59, which is still the most HP out of the whole bunch.
I'm sure that part was easy to understand...this part will get kind of tricky.  Basically, the key to your pokémon's success is to fight lots of monsters.  Yes, I said lots of monsters, monsters with a great deal of EXP.  This screenshot is the top pikachu out of the group of six. I will be using the SAME EXACT pikachu for the rest of the results on this page.
Here is the Pikachu after leveling up from a Rare Candy. This means that he leveled up without fighting any monsters.
Here is the Pikachu after gaining a level by fighting the monsters west of Viridian City. These monsters include Rattata, Nidoran (male and female), and Spearow, all ranging from levels 2-5.  Note that his stats are significantly higher than the Pikachu that used the Rare Candy.
Here is the Pikachu after gaining a level by fighting only level 5 Magikarps.  Notice that his HP special are the same as the screenshot above, but his defense and speed are higher and his attack is lower.  Why is that? Well, check the "base stats" for Magikarp: 
(base stats are the stats of the pokemon at level 50 if you don't fight any monsters.) 
HP: 20 
STR: 10 
DEF: 55 
SPD: 80 
SPC: 20 
Get it? So when you fight monsters, they give you "stat EXP" based on their base stats.  When your stat EXP reaches a certain amount, it ups your stat by 1.  And just like regular EXP, this leveling up of stats is exponential.  While it may just take 50 stat exp to gain one stat point, it may take 226 stat exp to gain two, 530 to gain three, etc.
WARNING: this section is not for the weak of mind. If you understood that and now want to go off fighting Magikarps, feel free.  But if you want to know when to stop, stick around.  The way the game works is that it only allows you to get 255 * 255, or 65025 stat exp for each stat.  So if you're looking to "max out", say, your pokemon's speed, you would need to fight 65025 / 80 (80 is Magikarp's base speed as shown above), or about 813 Magikarp.  That's alot of fishing! 

For a Pikachu (i'm not sure if it's the same for all other pokemon), the curve the game uses to determine how many stat points is given (for a Pikachu at level 50) is y = 64x˛ - 16x + 2, where x is the amount of stat points given and y is the amount of stat exp.  When you do the math this shows that a level 50 Pikachu can gain at most 31 stat points in each stat!! 

The bonus in a pokemon's stats when you first catch it can be at most 15 points at level 50.  To find out the most a pokemon's stats can be when you first catch one, use this algorithm: 
(level * (base stat + 15) / 50) + 5 
For a level 20 Pikachu at the power plant, to find the maximum value his attack could be: 
(20 * (55 + 15) / 50) + 5  =  33 attack 

Well that's all for now. As you can probably tell the actual math involved for a pokemon's stats is confusing, but not totally random.  Confusing, and I'm not much at explaining things well.

UPDATE:
I just thought i'd add this blurb about stat enhancers (you know, calcium, carbos...)
What these stat enhancers do is give you 2550 stat exp, and they can only give you up to 25500 (or ten starting from no stat exp) until they start saying (it won't have any effect).  25550 stat exp is a little less than half of the maximum 65025 stat exp a pokemon can get.

So what is my suggestion? If you are going to use stat enhancers, use them as soon as possible! Because you won't be able to use them later, when the only way you can increase your pokemon's stats any greater is by fighting.

Also, keep in mind that the stat exp passes by quickly. You don't have to fight for days to "max out" your stat exp. Just don't go fighting only the Elite Four to train your pokemon.