A pitcher receives a win when he is the pitcher of record when his team takes the lead for good -- with a couple rare exceptions. First, a starting pitcher must pitch at least five innings (in a traditional game of nine innings or longer) to qualify for the win. If he does not, the official scorer awards the win to the most effective relief pitcher.
There is also a rarely used clause where an official scorer can deem a relief pitcher's appearance "brief and ineffective." (For example, if a reliever relinquished a one-run lead by allowing three runs, but was still in line for a win after his team scored four runs in the following inning -- that may qualify.) If that's the case, the scorer can award the win to a pitcher who followed that "brief and ineffective" pitcher. Which relief pitcher earns the win specifically is also up to the judgment of the official scorer.
The importance placed on wins -- and losses, too -- has decreased among statisticians and baseball fans in the past few decades. The thinking is that a pitcher on a team with a bad offense (or bullpen) will often receive the loss even during games in which he pitched well. A pitcher can go nine innings without allowing a run, but he won't get the win if his team doesn't score.
Win-loss record was assigned a greater importance in the past for a different reason. During the time when starters pitched complete games routinely, bullpens were rarely at fault for losses. But today's specialization of relief pitchers has led to starters pitching fewer innings, leaving their win-loss fates in the hands of hurlers who enter games after them.
A starting pitcher does not necessarily receive a win every time his team wins -- even if he exits the game with his team ahead. In such instances, if the winning team gives up the lead before eventually rallying to win later in the game, the pitcher who is in the game when his team takes the final lead usually gets the win.
Watch: Max Scherzer earns a win after pitching six scoreless innings.
In A Call