When requiring finitely-generatedness of the resolution, then the free dimension of a projective module can be infinite. As a simple example, take the ring $R=k\oplus k$, and let $e_1=(1,0)$ and $e_2=(0,1)$ be the obvious idempotents. Then the module $ke_1$ is projective. However, any surjection $$ R^{\oplus n}\rightarrow ke_1 $$ will have a kernel $S_1$ which is isomorphic to $R^{n-1}\oplus ke_2$. Therefore, any surjection $$ R^{\oplus m}\rightarrow S_1 $$ will have a kernel $S_2$ which is isomorphic to $R^{m-n}\oplus ke_1$. Thus, any f.g. free resolution of $ke_1$ must infinite. Of course, as noted above, $ke_1$ has an infinitely-generated free resolution of length 2.