Team A is without that player for the duration of the penalty. During this time Team B is "on the power play". ie they have one more skater on the ice. Generally teams have 5 skaters and a goalie on each side, so the usual power play is a 5-on-4. Assuming Team B doesn't score, when the 2 minutes are up, the player in the penalty box is let out and rejoins the action, evening up the number of skaters on the ice, and ending the power play..
If Team B scores on the power play, the player in the box is generally let out, evening up the number of skaters, and ending the power play. If a player had been given two minors for a total of 4 minutes in penalties and Team B scored in the first 2 minutes, the first penalty would end, but the penalized player would still have to serve the second minor penalty. The most common type of "double minor" is given for a high sticking penalty where the high-sticked player was cut/bleeding.
If a player on Team B gets a penalty while they are on the power play, then that player will have to go to the penalty box, effectively evening up the number of skaters on the ice, and ending the power play. The game would continue at 4-on-4 until the Team A player's penalty comes to an end, at which point they'd be let out and would rejoin the play. Now team A would have 5 skaters to Team B's 4. Team A would now be on the power play until the Team B player's penalty ended, or Team A scored.
If both team's had a player in the box (so were 4-on-4) and one of the team's scored, it would not end their opponent's penalty. A player's penalty time is only ended when the opposing team scores on the power play.
For major penalties (5 minutes, if you'll recall), a player's penalty will not end, even if the other team scores on the power play. These are for more severe indractions, and a player is required to serve the full 5 minutes of the penalty, regardless of how many times their opponent scores on the power play. 5 minute power plays are infrequent, but do happen from time to time.
Lastly, there are misconduct penalties. These are of either 10-minute misconducts, or game misconducts variety.
A 10 minute misconduct is given to players usually for being an idiot. It could mean verbally abusing the official, jumping into a fight between two players (third-man in), and various other things. A player who is given a 10 minute misconduct sits out of the game for 10 minutes, but its not a power play. The teams would continue to play 5-on-5. Of course, most players tend to get a combination of penalties such as 2 minutes for instigating a fight, 5 minutes for fighting, and a 10 minute misconduct for being an idiot. So there's usually a power play, but only for the two or 5 minutes.
A game misconduct is generally handed out for intentional physical contact with the official (ref), intent to injure penalties (I know, you're generally always attempting to injure your opponent, but these are extreme gross violation of the rules types of penalties), and various things like that. A player may get a game misconduct just for repeated offenses throughout a game. Player gets in multiple fights, keeps getting penalties. A game misconduct penalty will last for the remainder of the game, regardless of when its given.
That is all....unless you have follow-up questions.












