In the same spirit as the other answers but making the problem more general, consider
$$I=\int_0^t \sin(x^2)\,dx=
\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)!}\int_0^t x^{4n+2}dx=\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)!}\,\frac{t^{4n+3}}{4n+3}$$ Writing
$$I=\sum_{n=0}^p\frac{(-1)^n}{(2n+1)!}\,\frac{t^{4n+3}}{4n+3}+\sum_{n=p+1}^\infty\frac{(-1)^n}{(2n+1)!}\,\frac{t^{4n+3}}{4n+3}$$ you then want to know the value of $p$ such that
$$\frac {t^{4p+7}}{(2p+3)!\,(4p+7)} \leq 10^{-k}$$ that is to say
$$(2p+3)!\,(4p+7) \geq t^{4p+7}\,10^{k}\tag 1$$ To simplify the problem we shall approximate the lhs $\big[(4p+7\sim 4p+8=2(2p+4)\big]$and rewrite $(1)$ as
$$ (2p+4)! \geq \left(t^2\right)^{2 p+4}\frac{10^k} {2t}\tag 2$$
If you look at this question of mine, you will see a magnificent approximation by @robjohn. Applied to your problem, this will give
$$\color{blue}{p \sim \frac 12 t^2\, e^{1+W(u)}-\frac 94} \qquad \text{where} \qquad \color{blue}{u=\frac 1{e\,t^2}\,\log \left(\frac{10^k}{2 t^2\sqrt{2 \pi } }\right)}\tag3$$ where $W(.)$ is Lambert function. For sure, after computing $p$ as a real, you will need to take $\lceil p\rceil$.
Applied to your case $t=1$ and $k=3$, this gives $p=0.90006$ then $p=1$.
Satrting from @DonAntonio's last equation (copy/paste)
$$|S-S_n|<|a_{n+1}|=\frac1{(2n+3)!(4n+7)}\stackrel{\text{we want!}}<\frac1{1000}$$ the exact solution would be $n=0.92604$. Checking with $n=1$
$$\frac1{5!11}=\frac 1{1320}$$
But now, suppose that you want a very high accuracy such as $k=20$ : using $(3)$, you would find $p=8.49617$ then $p=9$. The exact result for @DonAntonio's last equation would be $8.50041$.