Hit dice (HD) are the dice rolled to generate a creature's hit point total. The number of dice is equal to the creature's level, and the type of die is determined by the creature's classes. When used to indicate the number of dice, this term is most often applied to monsters, but it can be used in reference to any character.
For each level a creature has, the roll of the hit die for that level determines base hit points to which bonus hit points for constitution and toughness are added. This is subject to a 1 hit point minimum for the level (relevant if the constitution modifier is negative).
Most non-player characters (including monsters) do not actually roll hit dice, but instead have the total of their rolls assigned by the module creator. Bonus and minimum hit points still apply.