For a given conjugacy class $c$ each element has an identical Jordan form (which lives in $GL_3(\Bbb{F}_p^3))$. If the minimal polynomial has degree $3$ then its Jordan normal form looks like $$ \begin{pmatrix}\alpha & 0 & 0\\ 0 & \beta & 0 \\ 0 & 0 & \gamma \end{pmatrix}, \begin{pmatrix}\alpha & 1 & 0\\ 0 & \alpha & 0 \\ 0 & 0 & \beta \end{pmatrix} \text{ or } \begin{pmatrix}\alpha & 1 & 0\\ 0 & \alpha & 1 \\ 0 & 0 & \alpha \end{pmatrix}$$ for three distinct $\alpha, \beta$ and $\gamma$, the Jordan block necessary for the degree to be 3. This accounts for $p \cdotp\cdot(p-1)$ monomials of the form $x^3+ax^2+bx+c$ with $c \neq 0$.
If the polynomial has degree $2$ then each monomial with two different roots stands for two conjugacy classes with representatives $$ \begin{pmatrix}\alpha & 0 & 0\\ 0 & \alpha & 0 \\ 0 & 0 & \beta \end{pmatrix} \text{ or } \begin{pmatrix}\alpha & 0 & 0\\ 0 & \beta & 0 \\ 0 & 0 & \beta \end{pmatrix} $$ Since now $\alpha, \beta \in \Bbb F_p$ we have $(p-1)(p-2)/2$ monomials of the form $(x-\alpha)(x-\beta)$ standing for $(p-1)(p-2)$ classes. We have to add $p-1$ classes with monomial a quadratic of degree $2$ with discriminant $0$. These are represented by the matrices $$ \begin{pmatrix}\alpha & 1 & 0\\ 0 & \alpha & 0 \\ 0 & 0 & \alpha \end{pmatrix} $$ Finally the monomials of degree $1$ all give rise to scalar matrices, so there are $p-1$ of those classes.
Finally we obtain the result for the number of classes : $p^2(p-1) + (p-1)(p-2)+ (p-1)+ (p-1) = (p-1)p(p+1)$.
- The case $\operatorname{SL_2}(\Bbb{F}_p)$
We work analoguously as in the first case, by degree of monomial.
For degree two we have three possibilities : the first one is when the discriminant of the minimal polynomial is a square. This gives us $(p-3)/2$ matrices of the form $\left(\begin{smallmatrix} \alpha & 0 \\0 & 1/\alpha \end{smallmatrix}\right)$ where $\alpha \in \Bbb F_p \setminus \{-1,0,1\}$. Another case in degree $2$ is when the discriminant is not a square and $\alpha, \beta $ live in $\Bbb F_{p^2}$. There are $(p-1)/2$ of them. Then we have the matrices of the form $\left(\begin{smallmatrix} \alpha & \gamma \\0 & \alpha \end{smallmatrix}\right)$. A small calculation shows that there for each valur of $\alpha = -1,1$ there are two classes deoepending if $\gamma $ is a quadratic residue or not counting for $4$ additional classes, and if we add the two scalar classes $I$ and $-I$ we get the following result:
$(p - 3) / 2 + (p - 1) / 2 + 6 = p + 4$ classes