The answer is $\lfloor n^2/4\rfloor$, namely $m^2=n^2/4$ for even $n=2m$ and $m(m+1)=(n^2-1)/4$ for odd $n=2m+1$.
Indeed, one has a free abelian subgroup of rank $\lfloor n^2/4\rfloor$, consisting of upper unipotent matrices with two blocks of size $\lfloor n/2\rfloor=m$ and $\lceil n/2\rceil\in\{m,m+1\}$ in $\mathrm{GL}_n(\mathbf{Z})$:
$$\begin{pmatrix} I_m& *\\0 & I_{m}\end{pmatrix}\text{ or }\begin{pmatrix} I_m& *\\0 & I_{m+1}\end{pmatrix}.$$
Next, this is the upper bound.
Indeed, it is known that the largest dimension of an abelian subalgebra of matrices is $\lfloor n^2/4\rfloor+1$ (see this MO answer, attributing to Schur). Hence the maximal dimension of an abelian subgroup of $\mathrm{GL}_n$ is $\lfloor n^2/4\rfloor+1$. Given that such a subgroup contains the scalar matrices, one deduces that the largest dimension of an abelian subgroup of $\mathrm{SL}_n$ is $\lfloor n^2/4\rfloor$.
Now consider a free abelian subgroup of finite rank $r$ in $\mathrm{SL}_n(\mathbf{Z})$. Then its Zariski closure in $\mathrm{SL}_n(\mathbf{R})$ has dimension $d\le \lfloor n^2/4\rfloor$, and has a discrete subgroup isomorphic to $\mathbf{Z}^r$. Hence, the quotient of its unit component by its maximal compact subgroup has dimension $\delta\le d$ so is isomorphic to $\mathbf{R}^\delta$, and still has a discrete subgroup isomorphic to $\mathbf{Z}^r$. So $r\le\delta\le d\le\lfloor n^2/4\rfloor$.