I can give some general rules, but don't cling on to them as if your life depended on it. If there's nothing special about the pawns you're getting, then they probably won't be too dangerous and the side with extra force could probably end up winning some of them. So I think it's more likely the piece will be better.
A situation that would be good for the three pawns is if they're far advanced, connected (preferably) central, mobile, well supported, and are passed or could become passed. In that case the pieces would probably be pushed back and the piece would be of much less value, meanwhile the three pawns are a big threat. They also often have more potential in an endgame, simply because a big part of the endgame is getting the pawns pushed, so there would be a lot of time for that. But they need to be mobile; if they're not mobile that's not good.
In the opening or middle-game, where piece-play dictates the game, I would rather have a piece than the three pawns. In an endgame, I would prefer the pawns if they were connected and/or advanced far enough.
Once again, it is suicidal to rely on a catch-all thumb rule for a material-imbalance condition such as this, but it helps to know that the different stages of the game indicate a different way to look at the material on the board.