USA Hockey, rule 205 (c) says: When a substitution for the goalkeeper has been made under this rule, the goalkeeper shall not resume his position until the next stoppage of play, except that he shall be permitted immediate re-entry into the game when any penalty is imposed.
http://www.usahockeyrulebook.com/page/show/1084338-rule-205-change-of-players