When should you charge pawns in front of a castled king? In a situation where both players castle on the same side, is it ever a good idea to charge the pawns in front of the castled king? Are there any rules for when you can do this? I know that generally those pawns shouldn't move. But I am also increasingly finding it useful in my games to break up my opponent's king's defensive structure by pushing up pawns. If I don't see any obvious attack on my position, is it worth it? 

Here is an example position from my previous game. 
 

I played h3, stopping a further knight advance and looking at pushing g4 to close off the black's light square bishop. But my deeper idea was always to push those pawns right up to open up black's king. To be honest though, I'm still not sure whether this was a good idea at all.
Generally you should play on side where you have advantage in total firepower (P=1, N=3,...). In case of pawn storm in front of your king, the advantage should be bigger than you usually need. You can start easily minority attack with one extra horsie on the queenside, but you should probably not weaken your king seriously when you are just one knight stronger there.

Edit: To make the rule about firepower complete, I would say your king is somewhere around -8 for these calculations while your opponent's around -3. Takes time to get close to him while your king is already weak.

In this position I would play for b4. Good rule is that bishop g2 is very bad kingside attacker!