Rule 42 of the NHL rulebook dictates that: A minor or major penalty shall be imposed on a player who skates, jumps into or charges an opponent in any manner.
Charging shall mean the actions of a player who, as a result of distance traveled, shall violently check an opponent in any manner.
A 'charge' is generally the result of attempting to hit an opposing player beyond what is called for with a typical hockey body check.
This is based on the speed of the offending player, how the attacker propels themselves into the hit, or if they are targeting the goaltender.
[1] The infraction may warrant any severity of penalty or combination of penalties as the officials deem fit, including a major plus a game misconduct, or suspension if the infraction results in injury to the opposing player.