I love ice hockey but just started watching last season. I don't understand it all yet. 
I see, well its a simple game really. Two teams compete to shoot a rubber puck into the opponent's goal to score points!
That does sound easy. How do they get a penalty? I have seen people go to the box but unsure why. 
Its due to foul play by the opposition, sometimes when a move is seem as being too fast-paced and physical, the referee gives a penalty!
And how does overtime work, that still confuses me too!
Overtime is usually given for play beyond normal working hours for hockey players. Usually due to interruptions in the game that add up incrementally.
And then some players switch teams for playoffs? 
Precisely, these are in place in order to consider the players' health and productive play!
How long does a player play in a game?
They play as long as required or if they're subbed off by the coach, or even if there is a significant drop in viewership of the game!