An earlier question on this type of topic was asked by Zev Chonoles in 2010 at Which number fields are monogenic? and related questions and I want to draw your attention to the comment there by BCnrd for a nice geometric analogy. When answering that question I did not address the part Zev asked about finding rings of integers needing lots of generators as a $\mathbf Z$-algebra, so I'll do that here.
Pick an integer $r \geq 1$. Here is a sufficient condition on a number field $K$ that forces $\mathcal O_K$ to need more than $r$ generators as a $\mathbf Z$-algebra: there is a prime $p$ such that (i) $[K:\mathbf Q] > p^r$ and (ii) $p$ splits completely in $\mathcal O_K$.
Example 1. Taking $r = 1$ and $p=2$, to find a number field $K$ such that $\mathcal O_K$ needs at least two generators as a $\mathbf Z$-algebra ($K$ is not "monogenic") it is sufficient to find a $K$ such that $[K:\mathbf Q] > 2$ and $2$ splits completely in $\mathcal O_K$, such as a cubic field in which $2$ splits completely. Dedekind found the first example of such a field: $\mathbf Q(\alpha)$ where $\alpha^3 - \alpha^2 - 2\alpha - 8 = 0$. A method of constructing infinitely many such $K$ is to use the cubic subfield of the cyclotomic field $\mathbf Q(\zeta_p)$ for primes $p$ such that $p \equiv 1 \bmod 3$ and $2^{(p-1)/3}\equiv 1 \bmod p$; that means $p$ splits completely in $\mathbf Q(\sqrt[3]{2},\zeta_3)$, and there are infinitely many such $p$ (and hence infinitely many such cubic fields) since the density of such $p$ is $1/6$ by the Chebotarev density theorem. The first few such $p$ are $31$, $43$, $109$, and $127$. For example, using PARI and Galois theory, the cubic subfield of $\mathbf Q(\zeta_{31})$ is $\mathbf Q(\alpha)$ where $\alpha$ is a root of $$x^3 + x^2 - 10x - 8$$ and $2$ splits completely in this cubic field (e.g., PARI says this cubic polynomial splits completely over $\mathbf Q_2$) so the ring of integers of this cubic field needs at least $2$ generators as a $\mathbf Z$-algebra. (This cubic field is different from Dedekind's, e.g., Dedekind's cubic field has $1$ real embedding while this cubic field has $3$ real embeddings, of Dedekind's cubic field has discriminant $-503$ while this cubic field has discriminant $961 = 31^2$.)
Example 2. Taking $r = 2$, to find a number field $K$ such that $\mathcal O_K$ needs at least three generators as a $\mathbf Z$-algebra it is sufficient to find a $K$ such that $[K:\mathbf Q] > 4$ and $2$ splits completely in $\mathcal O_K$, such as a quintic field in which $2$ splits completely. A way to construct such fields is to use the quintic subfield of $\mathbf Q(\zeta_p)$ for primes $p$ such that $p \equiv 1 \bmod 5$ and $2^{(p-1)/5}\equiv 1 \bmod p$; that means $p$ splits completely in $\mathbf Q(\sqrt[5]{2},\zeta_5)$, and there are infinitely many such $p$ since their density is $1/20$ by Chebotarev. The first few such $p$ are $151$, $241$, $251$, and $431$. Using PARI and Galois theory as in the previous example, the quintic subfield of $\mathbf Q(\zeta_{151})$ is $\mathbf Q(\alpha)$ where $\alpha$ is a root of $$x^5 + x^4 - 60x^3 - 12x^2 + 784x + 128$$ and $2$ splits completely in this quintic field, so the integers of the quintic field need at least $3$ generators as a $\mathbf Z$-algebra.
I hope from these examples you see the pattern by which, for each $r$, you can use a subfield of degree $d$ in $\mathbf Q(\zeta_p)$ for infinitely many primes $p \equiv 1 \bmod d$ to get infinitely many number fields whose ring of integers requires more than $r$ generators as a $\mathbf Z$-algebra.
It is time to prove (i) and (ii) above are sufficient conditions for $\mathcal O_K$ to require more than $r$ generators as a $\mathbf Z$-algebra. Let $K$ be a number field such that $\mathcal O_K$ has at most $r$ generators as a $\mathbf Z$-algebra. We will show either condition (i) or (ii) has to break down, or more simply if (ii) holds then (i) does not: if $\mathcal O_K$ has at most $r$ generators as a $\mathbf Z$-algebra and a prime $p$ splits completely in $\mathcal O_K$ then we will show $[K:\mathbf Q] \leq p^r$.
That $\mathcal O_K$ has at most $r$ generators as a $\mathbf Z$-algebra is the same as saying there is a surjective ring homomorphism $\mathbf Z[x_1,\ldots,x_r] \twoheadrightarrow \mathcal O_K$. Reducing both sides modulo $p$ for an arbitrary prime $p$, there is a surjective ring homomorphism $\mathbf {\mathbf F}_p[x_1,\ldots,x_r] \twoheadrightarrow \mathcal O_K/(p)$. Let $I$ be the kernel, so $\mathbf {\mathbf F}_p[x_1,\ldots,x_r]/I \cong \mathcal O_K/(p)$ as rings.
Assume $p$ splits completely in $K$ (infinitely many primes split completely in each number field, so this assumption is not crazy). Then $\mathcal O_K/(p) \cong {\mathbf F}_p^n$ as rings, where $n = [K:\mathbf Q]$, so there is a ring isomorphism $\mathbf {\mathbf F}_p[x_1,\ldots,x_r]/I \cong {\mathbf F}_p^n$. The product ring $\mathbf F_p^n$ has $n$ maximal ideals, each with residue field $\mathbf F_p$, so there are $n$ maximal ideals in ${\mathbf F}_p[x_1,\ldots,x_r]$ that contain $I$ and have residue field $\mathbf F_p$. A maximal ideal in ${\mathbf F}_p[x_1,\ldots,x_r]$ with residue field $\mathbf F_p$ has the form $(x_1 - a_1,\ldots,x_r-a_r)$ where $a_i \in \mathbf F_p$. There are $p^r$ such ideals in total, so necessarily $n \leq p^r$. That is exactly the negation of condition (i) at the start.
Update: This proof extends to the relative case. If $E/F$ is an extension of number fields then a sufficient condition for $\mathcal O_E$ to need more than $r$ generators as an $\mathcal O_F$-algebra is that there is a (nonzero) prime ideal $\mathfrak p$ in $\mathcal O_F$ such that (i) $[E:F] > ({\rm N}\mathfrak p)^r$ and (ii) $\mathfrak p$ splits completely in $\mathcal O_E$. In the above proof, "ring homomorphism" has to be replaced by "$\mathcal O_F$-algebra homomorphism".