In general, there is no easy criterion. I recall the construction of two closed subspaces
of a Banach space whose sum is not closed: Let $T:X\to Y$ be a linear map between Banach spaces with closed graph $G= \{ (x,T(x)): x\in X }$. \}$. Then $L={(\xi,0): L=\{(\xi,0): \xi\in X}$
X\}$
is another closed (even complemented) subspace such that $G+L= X\times T(X)$ which is
closed if and only if $T(X)$ is closed in $Y$. Moreover, $G\cap L=0$ if $T$ is injective.
A concrete example is obtained for the inclusion $\ell_1 \hookrightarrow \ell_2$ (in this case the sum is dense).
(Sorry that the braces are missing. I don't understand this.)

