Consider the cumulative distribution function (cdf) of Z
$F_Z(z)=P(Z<=z)=P[(X<=z \wedge Y<=z)=\int_{-\infty}^z dx \int_{-\infty}^z dy\ P(x,y)$
You deal with discrete random variables with a compactly supported joint density of probablities over the rectangle $[1,2]\times [1,3]$ where the integral can be turned into a discrete sum with discrete steps $\Delta x=\Delta y=1$.
$F_Z(z) = \int_{-\infty}^z dx \int_{-\infty}^z dy\ P(x,y) = \sum_{i=1}^z \sum_{j=1}^z P(i,j)$
It is now clear that for $z>=3$ $F_Z(z)=1$ and for $z<1$, $F_Z(z)=0$ So you have only two values of the cdf to be calculated,
for $z=1$: $$F_Z(1) = P(1,1)= 0.12$$
for $z=2$: $$F_Z(2) = P(1,1)+P(1,2)+P(2,1)+P(2,2)= 0.50$$
Now you can obtain the probability density function (pdf) of $Z$ by discrete forward differentiating the cumulative distribution $P_Z(i)=F_Z(i)-F_Z(i-1)$ starting with
$P_Z(z) = 0$ for $z<1$ and $P_Z(z)=0$ for $z>3$.
$$P_Z(1) = 0.12 - 0 = 0.12$$
$$P_Z(2) = 0.50 - 0.12 = 0.38$$
$$P_Z(3) = 1.0 - 0.50 = 0.50$$
From this pdf yo will get the first and second order statistical moments
$E(Z) = \int P_Z(z) z dz = P_Z(1)*1+P_Z(2)*2+P_Z(3)*3 = 0.12+2*0.38+0.5*3=2.38$
$E(Z^2) = \int P_Z(z) z^2 dz = P_Z(1)*1+P_Z(2)*4+P_Z(3)*9=0.12+4*0.38+9*0.5=6.14$
You classically get the variance of $Z$ as,
$V(Z)=E([Z-E(Z)]^2)=E([Z^2-2ZE(Z)+E(Z)^2]=E(Z^2)-E(Z)^2=6.14-2.38*2.38=0.4756$
Hope this helps.