Too much is just as bad as not enough
Sleeping less than 7 hours can increase the risk for obesity, hypertension, diabetes, stroke, and heart disease. Sleeping more than 9 hours on a habitual basis can cause increased mortality, especially at older ages and can cause increased mortality just as much as sleeping less than 7. Please note that some studies have even shown poor sleep correlating with cancer risk.
Keep in mind that this is different for everyone, but we tend to habitually understimate the sleep we need.
While setting your alarm clock 8 hours from now may be seen as getting 8 hours of sleep, you are actually getting less as this does not account for normal nighttime wake cycles and nighttime onset.
How do you get that magic number?
While the emphasis int he literature is a "cocktail of behaviors," one tactic to reach that magic number is tally your sleep hours and how you feel over a week. This is easy. I would recommend just jotting it down on a notepad next to your bed to with a scale from 1 to Hungover and hours slept.