You accept when you find a Turing machine that outputs something which turns out to be the polynomial-time verifiable certificate for the NP problem.
You never reject, because the requirement was only to accept in polynomial time. (If you prefer, you could reject in exponential time by exhaustive search, of course.)