Without an example, the best answer i can give is...depends.
When to take pawns

Exactly. It depends.
Usually an important central Pawn should be taken if you can do it without compromising your position.

Here is a game I was looking over where I found this type of move. Instead of taking with Bxg4 Nimzovich plays Kg8!? I put into the computer and after 1... Bxg4 2. Qg2 black is simply up a pawn and should be winning. The only reason I could could think of that Nimzovich didn't play this move was because he didn't like the position in some way I don't understand.
Why are there two black kings on the board?
I didn't even spot that two Black kings were on the board. Presumably the a8 'king' is supposed to be a Black queen.

Why are there two black kings on the board?
I didn't even spot that two Black kings were on the board. Presumably the a8 'king' is supposed to be a Black queen.
So the other Q is not on d8?
Why are there two black kings on the board?
I didn't even spot that two Black kings were on the board. Presumably the a8 'king' is supposed to be a Black queen.
So the other Q is not on d8?
Perhaps.
Or could it be...a 'ghost'? Spooky.

We may never know the position intended above, however, I do have a general rule. Look to see if the taking of the pawn frees up the opponent to attack things with the now opened lines. If you don't see anything wrong with the attack, you should take the pawn. At worse, you'll get a good lesson in when to take pawns and what to look for. Most people's opponents aren't that deep anyhow, so you can probably gobble up pawns and put the burden of proof on the opponent.
I see a lot of grandmasters and even in the Grenke tournament going on right now passing up orputunities to pick up “free” pawns. Sometimes they even claim that taking it would be too gready. So I would like to know when to take pawns or not. For instance, would it be better to get my pieces to more active squares or if I have the option to defend a pawn, would it be better to waste time defending it, or should I play less passively. Thanks in advance.