The correspondence between affine vector bundles and f.g. projective modules The definition of a (geometric) vector bundle over a scheme $X$ can be rewritten as follows in terms of 'not-so-geometrical algebra' if $X=Spec R$ is affine and if I am not missing something.
A vector bundle of rank $n$ over $R$ is an $R$-algebra $A$ such that


*

*for every $p\in Spec R$ there is a isomorphism (belonging to the data)
$$
\phi_p:k(p)[X_1,...,X_n]\xrightarrow{\cong} A\otimes_R k(p)
$$
where $k(p)$ is the residue field $R_p/m_p$ and

*there are elements $\{a_i\}_{i\in I}$ of $R$ such that the $D(a_i)=\{ I\in Spec R\mid a\notin I \}$ cover $Spec R$ and for every $i\in I$ there is an $R_a$-algebra isomorphism
$$
A\otimes_R R_{a_i}\xrightarrow{\cong}R[X_1,\ldots,X_n]\otimes_RR_{a_i}
$$
which induces for every $p\in Spec R$ with $a_i\notin p$ a $k(p)$-linear $k(p)$-algebra isomorphism
$$
A\otimes_R k(p)~\xleftarrow{\phi_p}k(p)[X_1,...,X_n]\to k(p)[X_1,...,X_n]\cong R[X_1,...,X_n]\otimes_R k(p).
$$
The (isomorphism classes) of such vector bundles over $R$ should correspond to (isomorphism classes) of finitely gererated projective modules over the ring $R$.
How can this correspondence be seen?
 A: Given any $R$-module $M$, there is a scheme which corresponds to the 'total space' of $M$, given by 
$$ Tot(M):=Spec( Sym_R(M*))$$
where $M*$ is the dual module $Hom_R(M,R)$ and $Sym_RM*$ is the symmetric algebra of $M^*$ over $R$.  If $M$ happens to a free rank $n$ $R$-module, then $Sym_RM\simeq R[X_1,...,X_n]$.  The scheme $Tot(M)$ has a natural map to $Spec(R)$, which is dual to the obvious inclusion
$$R\rightarrow Sym_RM$$
If you start with a locally free, finite rank $R$-module $P$, and then consider its total space $Tot(P)$, the corresponding scheme is a vector bundle by your definition.  This follows from considering open sets on which $P$ is free, and considering the restriction of $Tot(P)$ over those open sets.  Since restriction to an open set is the same as tensoring over the localization, and localization commutes with forming symmetric algebras, the locally freeness becomes your second condition.  The first condition is also straightforward.
Then, observe that every vector bundle by your definition arises this way.  To see this, follow Mike's comment.  Associate to a vector bundle $V$ its sheaf of sections over $Spec(R)$, which is an $R$-module in a natural way.  It will be free over the open cover $D(a_i)$, with constant rank $n$.
Edit: As pointed out by roger, the total space construction should use the dual of $M$.  As a side note, this means that it is the same if you replace $M$ with $M^{**}$, and so it is not interesting to apply this construction to non-reflexive modules.
A: It may make more sense to look at the isomorphism class of a vector bundle as its corresponding isomorphism class as a locally free sheaf (Hartshorne: Algebraic Geometry - Exercise 5.18)
Then, it becomes clearer to see the connection by looking at the sheaf associated to a projective module $M$ - which is a locally free sheaf, since the the stalk at any $p \in SpecR$ is isomorphic to $M_p \simeq R^n$, and we have an open cover of $X=SpecR$ by the $D(a_i)$.
A: Even though there are many excellent answers above and included in the comments, let me try to offer an alternative view.
Let's say that $E\to X$ is a trivial geometric vector bundle. As a scheme, $E\simeq X\times \mathbb A^r$ (and I am simplifying a little bit, but the point here is intuition I suppose). Anyway, now if $X={\rm Spec}R$, then what is $E$? Well, what else but ${\rm Spec} R[x_1,\dots,x_r]$? And what is $E_x$ for some $x\in X$? If $x$ corresponds to the prime ideal $\mathfrak p\subseteq R$ then $E_x$ is just $\kappa(\mathfrak p)[x_1,\dots,x_r]$. 
OK, now if $E\to X$ is not trivial, but locally trivial, then the only thing that changes is that these should hold over some open cover of $X$. The topology of $X$ has a base by open sets of the form $D(a)$, so we may as well take our open cover consists of such open sets.
In other words we recovered your two conditions. Now go and check (possibly at the suggested references) that you can do the construction backwards. 
