How can we determine the number of factors by CRT?
For example,
$$\frac{\mathbb{Z}_5[X]}{X^2+1}\cong \frac{\mathbb{Z}_5[X]}{X+2}\times \frac{\mathbb{Z}_5[X]}{X+3},$$ so $\frac{\mathbb{Z}_5[X]}{X^2+1}$ is factored into two.
So in general, given a ring $R=\mathbb{Z}_p[X]/F(X)$ where $F(X)$ is of degree $d$, how many factors can we obtain for $R$?
And why it holds?
Not sure what version you are thinking of, but the Chinese Remainder Theorem I was taught applies to all rings
That is exactly what happens in this case since $(X+2)+(X+3)=R$ and $(X+2)(X+3)=(X^2+1)$.
(Addressing the addition to the question.)
In a polynomial ring over a field, you will be able to factor the polynomial into a finite product of powers of irreducible polynomials: $p(X)=\prod q_i(X)^{e_i}$. Then inductively using the theorem above, you will get $R/(p(X))\cong \prod R/(q_i(X)^{e_i})$. None of these factor rings can be broken down further since they are local rings.
The factorization of $p(X)$ could result in many pieces or only one: it depends totally upon the actual polynomial chosen. It could be as many as $deg(f)$ or as little as $1$.