To find the number of hours of nightly sleep a classmate would likely get if she spent 6 hours watching television each night, we can substitute \( x = 6 \) into the equation of the line of best fit, which is given as \( y = -x + 9 \).
Calculating \( y \):
\[ y = -6 + 9 \] \[ y = 3 \]
Therefore, if a classmate spent 6 hours watching television, she would likely get 3 hours of sleep.
The correct answer is D. 3 hours.