Proposition 4.7.5 Let $P$ be a left $R$-module and $\{u_i\}$ be a generating set for $P$.
Then $P$ is projective if and only if there exists $R$-module homomorphisms $\alpha_i:P\rightarrow R$ such that
(1) $\alpha_i$ is zero on all except finitely many $u_i$'s.
(2) Every $x\in P$ can be written as $x=\sum_i \alpha_i(x)u_i.$
This is from Cohn's Basic Algebra. Then there is a corollary
The case when the family $\{u_i\}$ is finite is worth stating separately:
Corollary 4.7.6 The module $P$ is a direct sum of $R^n$ if and only if there exists $u_1,u_2,\ldots, u_n\in P$ and $\alpha_1,\cdots,\alpha_n\in {\rm Hom}_R(P,R)$ such that equation in (2) holds.
Q. I did not understand statement of the corollary. $P$ is direct sum of $R^n$ means $R^n\cong P\oplus Q$ for some $R$-module $Q$? How this corollary follows from proposition?
Sure it is correct. We can consider the maps
$\alpha : R^n \to P$ such that $\alpha(a_1,\dots ,a_n):=\sum_{k=1}^n a_k u_k$
and
$\beta : \ker(\alpha) \to R^n$
the inclusion map. Then
$0\to \ker(\alpha) \to R^n \to P\to 0$
it is exact but P is projective so the sequence split:
$R^n=P\oplus \ker(\alpha)$