First: it is incorrect, in general, to even write $\dim(U\cup V)$, because $U\cup V$ is almost never a subspace: it is a subspace if and only if $U\subseteq V$ or $V\subseteq U$. Not being a subspace, it doesn't even make sense to talk about its dimension.
Rather, what you probably meant is the correct equation
$$\dim(U+V) = \dim(U) + \dim(V) - \dim(U\cap V)$$
(though I prefer to put the intersection on the left hand side, because in that form it is valid even in the infinite dimensional case). Here, $U+V$ is the smallest subspace that contains $U$ and $V$, and it happens to equal the set of all vectors of the form $u+v$ with $u\in U$ and $v\in V$.
The equation does not give you the full answer, because there are several situations that can occur: you could have $U$ and $V$ intersect trivially: this is what happens when $U+V=\mathbb{R}^4$. For an explicit example, you could have $U=\{(a,b,0,0):a,b\in\mathbb{R}\}$, and $V=\{(0,0,c,d) : c,d\in\mathbb{R}\}$. Here, $\dim(U\cap V)=0$.
Or you could have that $U$ and $V$ intersect in a one-dimensional subspace (for example, take $U$ as above, but take $V=\{(0,b,c,0) : b,c\in\mathbb{R}\}$).
Or you could have $U=V$, in which case the intersection has dimension $2$.
What you can say is: if the spaces are distinct, then the intersection will either have dimension 1 or dimension 0. But that is all you can say with the given information.