The notation $\vert m_1 m_2\rangle$ is a shorthand for $\vert m_1\rangle\vert m_2\rangle$, where $\vert m_1\rangle$ is a ket for the first spin alone, and $\vert m_2\rangle$ is a ket for the second spin alone.
Now the states of your first system are $\vert m_1\rangle$, and the states of your second systems are $\vert m_2\rangle$. For every fixed state $\vert \bar{m}_1\rangle$ your second system can be in any state $\vert m_2\rangle$. Thus, the possible states of your combined system are of the form $\vert m_1\rangle\vert m_2\rangle$.
Note that, in your Hamiltonian, $S_{1z}$ acts only on $\vert m_1\rangle$ and $S_{2z}$ only on $\vert m_2\rangle$, and $\vert m_1\rangle$ and $\vert m_2\rangle$ are assumed to be eigenkets of $S_{1z}$ and $S_{2z}$ respectively.
Thus:
$$
S_{1z}\vert m_1m_2\rangle=\Bigl(S_{1z}\vert m_1\rangle\Bigr)\vert m_2\rangle = \hbar m_1 \vert m_1\rangle\vert m_2\rangle=\hbar m_1
\vert m_1m_2\rangle\, ,
$$
and simlarly $S_{2z}\vert m_1 m_2\rangle=\hbar m_2\vert m_1m_2\rangle$ so
that
$$
\left(S_{1z}+S_{2z}\right)\vert m_1m_2\rangle=
S_{1z}\vert m_1m_2\rangle + S_{2z}\vert m_1m_2\rangle=
\hbar(m_1+m_2)\vert m_1m_2\rangle
$$
You can appreciate how the product form of basis states arises by analogy with the usual method of separation of variables: if you have a partial differential equation of the form - say -
$$
\left(\frac{\partial}{\partial x}+2\frac{\partial}{\partial y}\right)F(x,y)=F(x,y),
$$
you would naturally seek solutions in the product form $F(x,y)=X(x)Y(y)$, so that $\partial/\partial x$ acts only on $X(x)$ and $\partial/\partial y$ acts only on $Y(y)$. The solution you can find using $F(x,y)=e^{\lambda_1 x}e^{\lambda_2 y}$. Then
\begin{align}
\frac{\partial}{\partial x}e^{\lambda_1 x}=\lambda_1e^{\lambda_1 x} ,\\
\frac{\partial}{\partial y}e^{\lambda_2 y}=\lambda_2e^{\lambda_2 y}
\end{align}
so that
$$
\left(\frac{\partial}{\partial x}+2\frac{\partial}{\partial y}\right)
X(x)Y(y)=(\lambda_1+2\lambda_2)X(x)Y(y)= X(x)Y(y)
$$
from which you see that the sum $\lambda_1+2\lambda_2$ should be $1$. As you can see, although the solution is a product of functions, the eigenvalue is the sum of individual eigenvalues.
In your system, the Hamiltonian is a sum of Hamitonians $S_{1z}$ and $S_{2z}$, each acting on its part of the state, and the total eigenvalue is the sum of the individual $\hbar m_1$ and $\hbar m_2$ eigenvalues.