From NPTEL's Commutative Algebra online course, lecture 17 (link here in the time of the video the example is given), it is given the following example concerning a non-finite $\mathbb{Z}$-algebra:
Example: $B=\dfrac{\mathbb{Z}[x_1,x_2]}{\langle x_1^2\rangle}$ is a finitely generated $\mathbb{Z}$-algebra and a generating set for $B$ is $$ G=\{\overline{x}_1^j \overline{x}_2^i: 0\leq j \leq 1,\, 0\leq i \leq \infty\} $$ Note that $B$ is not a finite $\mathbb{Z}$-algebra.
From the definition of a finitely generated $A$-algebra (Atiyah - MacDonald pg 30):
The homomorphism $f:A\rightarrow B$ is of finite type and $B$ is a finitely generated $A$-algebra if there exists a finite set of elements $x_1,...,x_n$ in $B$ such that every element of $B$ can be written as a polynomial in $x_1,...,x_n$ with coefficients in $f(A)$.
Here obviously $A=\mathbb{Z}$. It's not clear to me why $B$ is a finitely generated $\mathbb{Z}$-algebra. The homomorphism $f$ is not given explicitely so I assumed it's $n\mapsto n\cdot 1$, so that $f(\mathbb{Z})=f(A)=\{ \overline{n} \in B: n\in\mathbb{Z}\}$.
I can't see why any element in $B$ is written as a polynomial (coefficients in $f(\mathbb{Z})$ of finite elements of $B$. It seems to me that given any finite set of $B$ i can find an element of $B$ outside its span. Maybe I got the definition wrong. Could someone explain it to me?