Is it true that when considering a degree $d$ polynomial $p(x)$ in a composite modulus $q$, it has more than $d$ roots (i.e., more than $d$ solutions to $p(x) \equiv 0 \pmod q$), and that when we consider $p(x)$ in a prime modulus $p$, it still satisfies the property of polynomials that it will have at most $d$ roots? If so, why? If not, is it only the case that with a composite modulus, we will sometimes but not always get more than $d$ roots?
I am asking because I have seen that $x^3 \equiv 0 \pmod 8$ has more than $3$ roots, but whenever I work over a prime it seems to always have at most $d$ roots, which has made me wonder what the relationship is between the modulus and how many roots there are, and most importantly why this relationship is the case.