Let $D$ be the Levi-Civita connection of $N$, $\nu$ the unit normal to $N$ and $A(X,Y) = -g(\nabla_X Y, \nu)$ the second fundamental form of $N$. Then $N$ being autoparallel is equivalent to $A = 0$ (we are restricting $A$ to tangent vectors of $N$).
The Gauss formula states that $$ D_X Y = \nabla_X Y - A(X,Y)\nu; $$
so for any curve $\gamma$ in N, we have $$D_\dot\gamma \dot\gamma = \nabla_\dot\gamma \dot\gamma - A(\dot\gamma,\dot\gamma)\nu.$$
From here it is immediately clear that $A=0$ implies $N$ is totally geodesic, since it means their geodesic equations coincide.
The other direction is almost as easy - if $\nabla_\dot\gamma \dot\gamma = 0$ whenever $D_\dot\gamma \dot\gamma=0$, then we have $A(X,X)=0$ for every vector $X$ tangent to $N$ (since we can find a geodesic with any initial condition $X$). Noting that $A$ is symmetric, the polarization identity $$A(X,Y) = \frac12 \left( A(X+Y,X+Y) - A(X,X) - A(Y,Y) \right)$$ then implies that $A = 0$.