Let $Z = X+Y$. Then, for any fixed value of $z$,
$$F_Z(z) = P\{Z \leq z\} = P\{X+Y \leq z\}
= \int_{-\infty}^{\infty}\left[ \int_{-\infty}^{z-x}
f_{X,Y}(x,y)\,\mathrm dy\right]\,\mathrm dx$$
and so, using the rule for differentiating under the integral sign
(see the comments following this answer over on math.SE
if you have forgotten this)
$$\begin{align*}
f_Z(z) &= \frac{\partial}{\partial z}F_Z(z)\\
&= \frac{\partial}{\partial z}\int_{-\infty}^{\infty}\left[ \int_{-\infty}^{z-x}
f_{X,Y}(x,y)\,\mathrm dy\right] \,\mathrm dx\\
&= \int_{-\infty}^{\infty}\frac{\partial}{\partial z}\left[ \int_{-\infty}^{z-x}
f_{X,Y}(x,y)\,\mathrm dy\right]\,\mathrm dx\\
&= \int_{-\infty}^{\infty}
f_{X,Y}(x,z-x)\,\mathrm dx
\end{align*}$$
When $X$ and $Y$ are independent random variables, the joint density
is the product of the marginal densities and we get the convolution
formula
$$f_{X+Y}(z) = \int_{-\infty}^{\infty}
f_{X}(x)f_Y(z-x)\,\mathrm dx ~~ \text{for independent random variables}
~X~\text{and}~Y.$$