Let,
$S=\begin{pmatrix} 0 &-1 \\ 1 & 0 \end{pmatrix}$
and
$T=\begin{pmatrix} 1 &1 \\ 0 & 1 \end{pmatrix}$ .
The matrices $S$ and $T$ generate $SL_2(\mathbb Z)$. The matrix $S$ has order $4 \: (S^2 = −I_2)$, while $T$ has infinite order.
Now consider we have an arbitrary element $\beta \in SL_2(\mathbb Z)$.
What is the process/ algorithm to determine/detect whether $\beta$ is an element of finite or infinite order?
A matrix with integer entries has finite order if and only if its minimal polynomial can be expressed as a product of distinct cyclotomic polynomials.
In the $2 \times 2$ case, things are easy. One method would be to follow the following procedure. Begin with the matrix $\beta \in SL(\Bbb Z)$.
If $\beta$ is either $I$ or $-I$, then it has finite order. Otherwise, proceed
Find the characteristic polynomial of $\beta$, $p(x) = x^2 - \operatorname{tr}(\beta)x + 1$. If we obtain one of the polynomials $$ \Phi_3(x) = x^2 + x + 1, \quad \Phi_4(x) = x^2 + 1, \quad \Phi_6(x) = x^2 - x + 1, $$ then $\beta$ has finite order (in particular, order $2,3,4,$ or $6$ respectively). Otherwise, $\beta$ has infinite order.
To summarize: a matrix $\beta \in SL(\Bbb Z)$ has finite order if and only if it is equal to $I$ or $-I$ or its trace satisfies $\operatorname{tr}(\beta) \in \{-1,0,1\}$.