Take a basis for $U$ and complete it to a basis for $V$. The basis elements for $U$ must map to linear combinations of themselves. However, the remainder of the basis can map to anything.
Fix some notation: Let $u_1,\dots,u_m$ be a basis for $U$ and $u_{m+1},\dots,u_n$ be vectors which complete this to a basis for $V$.
We can build up a basis for $B(U)$ as follows: (1) Fix $1 \leq i \leq m$. Let $T(u_i)=u_j$ ($1 \leq j \leq m$). Send all other basis vectors $u_k$ to $0$: $T(u_k)=0$ for all $k \not=i$. (2) Fix $m+1 \leq i \leq n$. Let $T(u_i)=u_j$ ($1 \leq j \leq n$). Send all other basis vectors $u_k$ to $0$: $T(u_k)=0$ for all $k \not=i$.
All of the linear maps of type (1) and (2) are members of $B(U)$. It's easy to see they're linearly independent and they span. So the dimension is $m \cdot m + (n-m) \cdot n = n^2 -mn+m^2$.
[$U=0$ and $U=V$ give you $m=0$ or $m=n$ and $B(U)=\mathrm{Hom}(V,V)$. In these cases we find that $\dim(\mathrm{Hom}(V,V))=n^2$]