The most important rule of thumb you have to remember to be a good chess player: All rules of thumb in chess have exceptions. Even this one.
As a beginner, get in the habit of castling early, because it's generally a good idea. But as you get more experienced, and learn some "book" opening moves, you'll realize that sometimes castling too early lets your opponent know where to focus his attack. So sometimes, it's better to develop all your pieces on both sides of the king, to make room to castle either way, depending on what your opponent does. Or if the center pawn structure gets locked up, your king maybe actually be safer sitting in the middle behind it, while both players attack on the wings.
There is no hard and fast rule. As with most things in chess, start with the rule of thumb (Castle as soon as you can), and as you become more experienced, you'll learn to spot good times for exceptions.
I originally had it in my mind that 'Castle asap' was the best move. But after looking at some forum posts, it has been said that you should normally wait before you castle. Is this true? When is the best time to castle? Often I castle as soon as the opportunity arises or straight after my opponent has castled.