I understand that hit points are linked to the "hit die". But is the hit die a constant number (for example: if my PC has 1d8 hit die, I have 8 HPs), or do I need to actually roll the die to see how many HPs I have?
For player characters, hit die are rolled once for each hit die achieved.
Every time a PC acquires a new hit die (which is generally exactly once per level at the time of level-up), they roll the hit die and add the number rolled to their hit points (plus additional modifiers). For example, when a fighter gains a level, he rolls 1d10 and acquires HP equal to the amount rolled. Hit dice are only rolled once, and the result is permanent and binding.
As an exception to the rule, the amount of HP a player gains at first level (for their first hit die) is equal to the maximum amount of the hit die without rolling. For example, a 1st level fighter would gain 10 hp (plus relevant modifiers) by simply "pretending" that he rolled a 10 on 1d10 instead of actually rolling. Subsequent levels would have him roll as noted above.
Monsters can sometimes use shortcuts.
Often, it is impractical to roll the HP for every individual monster. While they technically use the same rules, it is also acceptable to use an average amount of HP for them without rolling. The Monster Manuals automatically give you what this amount would be in parentheses for your convenience. If you don't feel like rolling, simply use these amounts for all monsters.
Certain House-Rules subvert these rules.
Player Characters can use the rule of using the average amount without rolling as well if the DM so desires. This means keeping track of fractional amounts of HP which don't count until they make a full HP, due to the fact that all of the die-sizes in the game have an even number of sides. For example, "half" of a d10 is 5.5 (not 5, which is actually in the lower half of the range). Therefore, a Fighter using this rule would gain 10 HP at level 1 (still using the max HP at 1st level rule), 5 HP at level 2 (with an extra 0.5 in reserve), 6 HP at level 3 (using the two halves of an HP to make an extra 1), and then continue to alternate between 5 and 6 on subsequent levels.
As an alternative, one can used a revised version of those house rules and just round the numbers up to the next highest whole number. That way, you don't have to deal with fractions, and characters only end up half of an HP stronger than average - a good tradeoff if you just don't like math. That means that d4 = 3HP, d6 = 4HP, d8 = 5HP, d10 = 6HP, and d12 = 7HP. Don't forget to add the correct modifiers at each level as well, as well as use the max amount for 1st level.
Hit die after the first can be rolled or you can just use the max value for the die when determining hit points. Overall it isnt too much of a power difference unless you are comparing someone who managed to roll all 1s versus all max values. Using the max value just alleviates player stress on something that is "within their hands but completely random can completely screw over a character permanently". Ever see an unlucky barbarian? Its not a pretty sight, seeing a meat shield that has as much hp as a commoner because of crappy rolls.
Personally my groups always use the Use max hit die for the level method. Its just less stressful. However it is up to the DM entirely to use this method for determining HP.
Just be sure to remember all the modifiers either way (Con mod, favored class, toughness if applicable)