From Rule 9.6
A player on the ice whose helmet comes off during play shall be assessed a minor penalty if he does not exit the playing surface, or retrieve and replace his helmet properly on his head (with or without his chin strap fastened), within a reasonable period of time. It is reasonable if a player who is making a play on the puck or who is in the vicinity of the puck and engaged in the play at the time his helmet comes off, takes the opportunity to complete the play before either exiting the ice or retrieving and replacing his helmet.