The polynomial $f(x)$ has to be irreducible in $\mathbf Z[x]$ in order that $\mathbf Z[x]/(f(x))$ is an integral domain. But determining whether this domain is a PID is an open problem and could be considered a central problem in algebraic number theory. We don't yet even know that infinitely many integral domains of the form $\mathbf Z[x]/(f(x))$ are PIDs.
A necessary condition for $\mathbf Z[x]/(f(x))$ to be a PID is that it is integrally closed, since every PID is integrally closed. You can look up the definition of being integrally closed in case you don't know what it means. It is a subtle property, especially if you never heard of it before.
You ask what the "size" should be. I think that you are confusing PIDs and Euclidean domains: a Euclidean domain has a size function, but a PID does not. The ring $\mathbf Z[(1 + \sqrt{-19})/2] = \mathbf Z[x]/(x^2 - x + 5)$ is known to be a PID but not a Euclidean domain. However, the generalized Riemann hypothesis implies that if an integral domain of the form $\mathbf Z[x]/(f(x))$ is a PID, then it is Euclidean except when $f(x)$ is quadratic with non-real roots. Since the generalized Riemann hypothesis is widely believed to be true, usually for domains $\mathbf Z[x]/(f(x))$ the properties PID and Euclidean are the same. But I did mention a counterexample.
Traditionally we think about using the absolute value of the norm map $\mathbf Z[x]/(f(x)) \to \mathbf Z$ as a Euclidean function. This does work in some cases, like $\mathbf Z[i]$ and $\mathbf Z[\sqrt{2}]$, but usually it does not: we expect infinitely many nonisomorphic real quadratic $\mathbf Z[x]/(f(x))$ are Euclidean, but it's known that only finitely many are norm-Euclidean: see Norm-Euclidean rings?.
In summary, your question is probably more complicated than you expected.