Yes, a generating set of minimal cardinality must have cardinality $r=rank_R(M)$.
It suffices to show that for any generating set of $M$ with $s$ elements, we have $s\geq r$ .
Assume that $M=R^r$.
Our generating set gives rise to a surjective $R$-module morphism $R^s\to R^r\to 0 \quad (\star)$.
Let $\mathfrak m\subset R$ be a maximal ideal and tensor $(\star)$ with the field $k=R/\mathfrak m$ .
You get a $k$-linear map $k^s\to k^r \to 0 \quad$ which is still surjective by right-exactness of the tensor product.
Since $k$ is a field, this implies $s\geq r$.
Edit
Since Bruno just commented that he is also interested in the case of infinitely many generators, let me reassure him that the above reasoning remains true, with the obvious change from integers to cardinals and minor cosmetic adaptations in notation.
More precisely, we assume that $M=R^{(B)}$ where $B$ is a basis of $M$ of cardinality $card (B)=\beth$.
If $A$ is a generating set of $M$ of cardinality $card(A)=\aleph $, we have a surjective morphism $R^{(A )}\to R^{(B )} \to 0 \quad (\star)$ yielding once more by tensorization (still right-exact!):
$k^{(A )}\to k^{(B )} \to 0 $ and the conclusion is again $\aleph \geq \beth$.