$|w|$ steps are needed to scan the input, if a left move is made during this scan accept.
Otherwise, at the end of the input, the head of the Turing machine is on the blank part of the tape (over the first blank symbol after the input). Suppose the state is $q_{i_1}$. If the Turing machine doesn't make a left step and stays on state $q_{i_1}$, then it will do it forever (it will continue moving right on the infinite blank tape on state $q_{i_1}$). But it can move right and switch to state $q_{i_2}, i_1 \neq i_2$.
If you continue with this reasoning you see that there are only two possibilities:
But there are only $N$ different states so at most $N+1$ more steps are needed to detect such loop.