Slow playing a huge hand like AA or KK is a bit like taking a penalty and dinking it down the middle. If all goes to plan it looks awesome, but if it goes wrong everyone is very quick to criticize. "You should never slow play AA mate" is the proverbial cry from the terraces, and patently explaining that you wanted the guy all in with A9 on the 9 high board, that was kind of the whole point of the exercise, is not going to shut them up.
However, refusing to ever slow play means that you're going to pass up great opportunities to win big pots. The key is to know when it's optimal to slow play, and when you should come out guns blazing.
The first thing to consider when deciding whether or not to slow play is your own table image. If you've been very aggressive recently, making lots of bets, reraising, etc, then sometimes now is not the best time to slow play. You could take advantage of your recent activity by over-betting your hand in fact, hoping that someone picks this spot to put you to the test. If on the other hand you've been quiet passive recently, or made a few weak bets and been reraised off pots, then slow playing may be a good idea, hopping someone thinks they can just run over you again.
The strength of your hand is vital to slow playing, and only particularly strong hands should be played pre-flop in this way. Hands like 1010, JJ, AQ, AK usually are not strong enough to warrant slow playing, and the same is often true of top pair or bottom 2 pair on the flop. When slow playing on the flop, take into account the texture of the flop - slow playing 1010 on a 10 5 2 rainbow flop is obviously a much better plan than doing it on a 2h10cJc flop.
Next, look at your opponents remaining in the hand. Do you have a decent amount of information on them? Have you been at the table long enough and paying enough attention to how they've been playing? If you're in early position then just a general idea of how the table is playing is a good start. If people have been raising a lot pre flop, or have they just been limping? Has anyone being trying to imposes their self on the table, raising every hand? If you're in a later position, with fewer opponents in the hand, then you can focus on them individually, and whether they've been raising a lot or limp-folding.
There are two main ways to slow play preflop, either introducing a pot with a limp with the express intention of getting more people into the pot and reraising if you get the chance, or flat calling a raise from a position where you are fairly sure the pot will be heads up or 3-way at most.
The former is obviously achievable by limping in from early position, hoping that a few more people will do so, and that at least one person will raise, allowing you to reraise and isolate. The idea here is to slow play only until someone raises, at which point you reraise, making sure you do not find yourself with more than one opponent on the flop, if any. The trouble here is letting more people into the pot, and not being able to reraise if nobody raises. For this reason it makes sense to only do this if your table has been quite active, with lots of raising preflop. It also helps if you've limped a lot recently, so it will not seem suspicious.
This plan's perfect exit is when you limp 1st position with AA, and a player 2nd or 3rd to act makes a small raise. A few people call, the more the merrier, and when it comes back round you make a sizeable reraise. Keep in mind here that this can look a bit obvious, and it actually looks more obvious with a weaker reraise, and everyone will have more value to call, so it makes sense to make a bigger bet. As a rule, the more people who are still in when it gets to you, the larger your reraise needs to be.
For example - with blinds at say 50/100, on a very active table, you limp with AA from a 4k stack, and 2nd to act with 3k raises to 250. 3 players call, all with 4-5k, and its back on you. There's now 950 in the pot, a decent amount, but 4 other players in the pot. Depending on who the players are and how they've been playing, I'd recommend a reraise from 1000 upwards. The last thing you want really is 2 or more callers, especially out of position. If you do get called, then you can either shove the flop, or possibly make a smaller bet depending on the texture of the flop.
The second way relies a bit more on individual knowledge of a player who has already made a raise. The raise and your position need to such that you're either really last to enter the pot, or everyone else remains is probably to fold. You flat call hiring for a heads up pot in which your opponent has no idea how strong your hole cards really are.
Opponents who have been continuing betting a lot are the best people to make this play against, out of position you can check to them with a decent likelihood of them betting out, or in position you can see what they do first. Either way the slow play can be transported further, depending again on the flop texture.
Against a tight opponent you are often better off putting in a reraise preflop for 2 reasons - firstly they are less likely to continue their aggression on the flop without hitting, but also because they must have a better hand in the first place for them to be raising, giving you more chance of getting paid off for a reraise pre.
The main thing to note with the slow play is that it will inevitably lead to you getting in situations where it's prudent to fold your big hand on the flop. Ability to get away from a hand and not fall in love with your big pair is vital here, and if you can not put down AsAc on a multi-way 9h10dJd flop with lots of action, then I do not advise trying to slow play in the first place, especially not the limping from early position method. If you're going to slow play, sometimes you're going to have to fold if it goes wrong.
Overall it's about picking the right table or opponent, the right time and position, and being able to get away if it all goes wrong. Do not be tempted to slow play just because you've been card dead for ages until now, make sure you consider all the angles first. It's not a move that should be overused, but timed well it can be an important part of your poker arsenal.