Yes, when only the black remains only seven more points can be scored. This is irrespective of whether or not the leader's margin is less than seven points. The only exception is when those seven points will result in the scores being level. Rule 4 of the game:
4. End of Frame, Game or Match
(a) When Black is the only object ball remaining on the table, the first score or foul ends the frame excepting only if the following conditions both apply:
(i) the scores are then equal; and
(ii) aggregate scores are not relevant.
The rules then go on to explain what happens in that event (the black is respotted).