Castling

After castling, is it a good idea to create an escape square for your King by moving a pawn in front of him as soon as possible?
Generally, no!
>>Is there a general rule of thumb?
The general rule of thumb is: "The king is safest in a castled position, behind a row of 3 unmoved pawns." Like so:
>> Or is it better to let the situation dictate when to create the escape square?
Yes it's better to do that.
This article is closely related to the subject we're discussing. I recommend that you take a look: http://www.chesscafe.com/text/heisman48.pdf
Also keep in mind that rules of thumb are just guidelines. They're true maybe 75-85% of the time, but there are exceptions.