Number of elements of prime order $p$ in $\mathrm{SL}_2(\mathbb{F}_q)$ Let $p,q$ be prime numbers.
It is known that there is one element of order $2$ in $\mathrm{SL}_2(\mathbb{F}_q)$.

How many elements of order $p>2$ are there in $\mathrm{SL}_2(\mathbb{F}_q)$?

 A: I'll answer to a more general question: if $q$ if an odd prime power, how many elements of order $n$ does $\newcommand\Fq{\Bbb F_q}\newcommand\SL{\mathrm{SL}_2(\Fq)}\SL$ have, for $n>2$? I will do so using only linear algebra. I'll put $p=\operatorname{char}(\Fq)$, which conflicts with the use of $p$ in the question, but will be needed only in the case where $n=p$.
Since $n>2$ excludes multiples of the identity, the minimal polynomial of candidates $A\in\SL$ will be equal to their characteristic polynomial$~\chi_A$, which is of the form $\chi_A=X^2-2a+1$ with $a\in\Fq$. One has $\chi_A=(X-a)^2$ if $a\in\{1,-1\}$ and otherwise $\chi_A$ is square-free; in the latter case $\chi_A$ will split over$~\Fq$ if its quarter-discriminant $a^2-1$ is a square in$~\Fq$, and is irreducible (but split over $\Bbb F_{q^2}$) otherwise.
Since $\chi_A$ is the minimal polynomial, $A$ is not diagonalisable over$~\overline\Fq$ in the case $\chi_A=(X-a)^2$ with $a\in\{1,-1\}$. Therefore in this case $A$ is conjugate to a matrix of the form
$$
  \begin{pmatrix}a&x\\0&a\end{pmatrix}
  \qquad\text{with $a\in\{1,-1\}$ and $x\in\Fq^\times$},
$$
which has order $p$ if $a=1$ and order $2p$ if $a=-1$. Moreover since there is only one $p$-th root of unity in characteristic$~p$, every element$~A$ of order $p~$or$~2p$ must have minimal polynomial $(X-1){}^2$ respectively $(X+1){}^2$. The subgroups conjugate to the upper triangular matrices are characterised by the $1$-dimensional subspace of which they are the stabiliser, so the number of such subgroups is $q+1$, and each one contains $q-1$ elements each of orders$~p$ and$~2p$, for a total of $q^2-1$ elements in$~\SL$ of each of the orders$~p$ and$~2p$.
If $a^2-1$ is a square in$~\Fq$, then $A$ is diagonalisable, with eigenvalues $a\pm\sqrt{a^2-1}$ (which are mutually inverse elements of $\Fq^\times\setminus\{1,-1\}$), and has order dividing $|\Fq^\times|=q-1$. Since $\Fq^\times$ is cyclic, every $n\mid q-1$ is the order of $\phi(n)$ different elements in $\Fq^\times$, and so there are $\phi(n)/2$ different pairs of eigenvalues giving rise to elements of such orders$~n>2$. For each pair one can choose a decomposition into eigenspaces in $(q+1)q$ different ways, for a total of $\frac{\phi(n)}2q(q+1)$ elements in$~\SL$ of order $n>2$ dividing$~q-1$.
Finally if $a^2-1$ is not a square in$~\Fq$, then $\chi_A$ is irreducible but splits over $\Bbb F_{q^2}$; moreover its eigenvalues $\lambda,\lambda^q$ have product$~1$, so $\lambda$ is a $q+1$-st root of unity in $\Bbb F_{q^2}$. Also every $n>2$ dividing $q+1$ is the order of $\phi(n)$ distinct such roots, with again $\phi(n)/2$ distinct characteristic polynomials giving rise to elements of order$~n$. For matrices$~A$ with such $\chi_A$, the first canonical basis vector $e_1$ together with $A\cdot e_1$ form a basis (as there are no eigenvectors), on which $A$ is given by the companion matrix for$~\chi_A$. Fixing $n$ there are $\phi(n)/2$ choices for$~\chi_A$ and independently $q^2-q$ choices for$~A\cdot e_1$, for a total of $\frac{\phi(n)}2q(q-1)$ elements in$~\SL$ of order $n>2$ dividing$~q+1$. In summary:


*

*for $n=1,2$ there is one element each of order$~n$,

*for $n=p,2p$ there are $q^2-1$ elements each of order$~n$,

*for $n>2$ dividing $q-1$ there are $\frac{\phi(n)}2q(q+1)$ elements of order$~n$,

*for $n>2$ dividing $q+1$ there are $\frac{\phi(n)}2q(q-1)$ elements of order$~n$,

*these are al the orders that occur in$~\SL$.


One checks easily that this accounts for all $q(q^2-1)$ elements of$~\SL$.
A: $(p-1)q(q+1)/2$ if $p|q-1$.
$(p-1)q(q-1)/2$ if $p|q+1$.
$p^2-1$ if $p=q$.
A: The answer is going to vary with $p$ and the factorization of the order of $Sl_2(F_q)$, which is $q^3-q$.
For example with $q=101$, we have $|Sl_2(F_{101})|=2^3\cdot3\cdot5^2\cdot 17\cdot101$.
So you can see, there won't be any elements with order a prime not appearing here, and if $p$ is a prime in the factorization, then we'd need to count how many elements are in the $p$-Sylow subgroups of $Sl_2(F_{101})$. It seems like that would need to be done on a case-by-case basis.
