Mathmo123 already wrote a comment which is really an answer, but I just want to add some details.
For the case $SL (2,\mathbb {Z})$ the holomorphicity at the cusp, which is also sometimes written as a growth condition, is \emph{equivalent} to the fact we can write our modular form as a Fourier expansion with non negative indices. We use the fact that the modular form is holomorphic at the cusp when we prove the well known formula about the multiplicities of the zeroes of a modular form of weight $k$ on the full modular group
$$\frac{k}{12}=\sum_{p\in\Gamma_1/\mathbb{H}}{mult_p (f)} +\frac{1}{2}mult_{i}(f) +\frac{1}{3}mult_{\omega}(f)+ mult_{\infty}(f),$$
where in the sum you take the non elliptic points.
This formula, combined with a linear algebra argument, leads to the final dimensionality of the space of modular forms.
This is subsequent to the compactification of the quotient space of the action of $SL (2,\mathbb {Z})$ on $\mathbb{H}$. This is not a priori compact, as you can see observing the fondamental domain of this action. The compact space is obtained just adjoing a cusp (the orbit of $\mathbb{Q}\cup\{\infty\}$) and of course you need holomorphicity at infinity to be able to write $mult_{\infty} f$ in the above formula.
A good reference for these facts is the first paragraph of Don Zagier's chapter in the book "1-2-3 of Modular Forms".