It's a little more technical than that, but I'm not entirely sure about all the details. 
What I gather is you have to come in with the number of outs you need equal to or less than the number of runs you are ahead by, unless there are runners on, which kinda complicates things.
Scenerio 1: If a pitcher comes in during the 9th with nobody out and his team is up by 3. He needs to get 3 outs, and thus face at least 3 batters to close the game. If he does so, he gets a save. If he gives up the lead, he gets a blown save.
Scenerio 2: If a pitcher comes in during the 9th with one out remaining, and the team is up by 3 with no runners on, then it's not a save opportunity. However, if he came in with 2 runners on base in the same situation, it would be a save opportunity.