The dimension counting formula may come in handy:
$\operatorname{dim} (W_1 + W_2) = \operatorname{dim} (W_1) + \operatorname{dim} (W_2) - \operatorname{dim} (W_1 \cap W_2).$
Hence if $\operatorname{dim} (W_1) = \operatorname{dim} (W_1 \cap W_2)$, we have that $ \operatorname{dim}(W_1 + W_2) = \operatorname{dim} W_2$ by the formula above. Now $W_1 + W_2$ is defined to be the subspace of $V$ whose elements are of the form $w_1 + w_2$ where $w_i \in W_i$. Now how can this formula hold? If $W_1$ and $W_2$ intersect trivially the sum of the two spaces becomes direct so that in fact we are calculating $\operatorname{dim}(W_1 \oplus W_2) = \operatorname{dim} W_1 + \operatorname{dim} W_2$ .
Plugging this into the formula $\operatorname{dim} (W_1 + W_2) = \operatorname{dim} W_2$ we get that $\operatorname{dim} W_2 = 0$. So now if we don't want degenerate cases like that we may assume that $W_1$ and $W_2$ have non-trivial intersection. Your job now is to tell me why $\operatorname{dim} (W_1 + W_2) = \operatorname{dim} W_2$ implies that $W_1 \subset W_2$ assuming $W_2$ is not the zero space.
Hint: If $U$ is a subspace of $V$ and $\operatorname{dim} U = \operatorname{dim} V, $ then $U = V$.
Therefore you have found a necessary condition for your formula to hold. Is this condition sufficient? Well it should be clear from the dimension counting formula above because then $\operatorname{dim} (W_1 + W_2) = \operatorname{dim} W_2$ so that cancelling terms on both sides of the formula and rearranging we get
$\operatorname{dim} W_1 = \operatorname{dim} (W_1 \cap W_2).$