It depends on what you are playing, cash games or tournaments. You also need to take into account the style of the game and the strategy of your opponents. There are so many different nuances, so it is hard to give you a specific answer.
It depends on a few factors.What is your position on the table? Are the players behind you likely to raise? How big is the players stack? Will I get paid if I hit my set? You should base your decision on the information you have on the players at the table. The beauty of poker is to adapt and not always play your hands in the same way.
If I'm deep enough(30+bb) with the raiser, then I'm calling any pairs. But that's the perfect case, mostly raiser will be short or there'll be a lot of shortstacks who can easily shove over you which you need to take into consideration.