Given two vectors $v,w\in \mathbb{R}^n$, the angle $\theta$ between them is defined by $\cos(\theta)=\frac{\left\langle v, w\right\rangle}{\|v\|\|w\|}$. One should wonder whether this is actually well-defined, i.e. $\frac{\left\langle v, w\right\rangle}{\|v\|\|w\|}\in [-1,1]$. By the Cauchy-Schwarz inequality, one has that $|{\left\langle v, w\right\rangle}|\leq \|v\|\|w\|$, hence $\cos(\theta)$ is at least well-defined.
In fact, the above definition makes sense in any inner-product space. Hence one can talk about angles between vectors in a lot of other vector spaces as well.
The two equations are somewhat different though, the first one links angles between vectors with their inner-product and lengths whereas the second merely gives the inner product. Given two vectors in $\mathbb{R}^n$, you can easily determine their lengths and inner products, but you cannot find the angle between them without this knowledge.