Is there a relation between the idempotent elements of a ring $R$ and those of $M_{n}(R)$  the ring of $n \times n$ matrices over $R$?
Any idempotent $e$ of $R$ induces an idempotent $E=\mathop{diag}(e,\ldots,e)$ of $M_n(R)$. In fact, if $e_i$ are idempotents in $R$, then $E=\mathop{diag}(e_1,\ldots,e_n)$ is an idempotent of $M_n(R)$.
Conversely, if $R$ is nice enough, an idempotent $E$ in $M_n(R)$ can be diagonalized to $E=U^{1} \cdot \mathop{diag}(e_1,\ldots,e_n) \cdot U$ for some $U \in M_n(R)$ and idempotents $e_i$ in $R$.
Of course, this relies crucially on $R$ being nice enough. One sufficient "nicety" condition is that $R$ is an AW*algebra; see for example this paper.
Yes. You can see the relationship easily in the following way. Suppose the ring $R=R_1\times R_2$ so that there are two primitive idempotents $e_1$ and $e_2$ with $1=e_1 +e_2$. Next note that $M_n(R)\approxeq Hom_R(R^n,R^n)$. Then $M_n(R)\approxeq Hom_{R_1\times R_2}(\(R_1\times R_2\)^n,\(R_1\times R_2\)^n)\approxeq Hom_{R_1}(R_1^n,R_1^n)\times Hom_{R_2}(R_2^n,R_2^n) $ since $e_1 \centerdot Hom_{R_2}(R_2^n,R_2^n)=0$ and similarly for $e_2$. Thus idempotents are calculated relative to each factor in the ring decomposition.

2$\begingroup$ I think you answered a question different from the one asked ;) $\endgroup$ – Mariano SuárezÁlvarez Nov 25 '12 at 23:00

$\begingroup$ Dear Ray, Thank you very much of your answer. If we have idempotent of $R$ then it is easy to generated for $M_{n}(R)$, But i want to construct idempotent for $R$, if we have idempotent of $M_{n}(R)$. so the above proof is not useful for me, $\endgroup$ – Ali Nov 26 '12 at 4:19

1$\begingroup$ Hi.Let $F$ be an infinite field, then there exist infinitely many distinct pair $(I,J)$ of minimal left ideals of $M_2(F)$ such that $M_2(F)=I \oplus J$. so this shows that in this case $F$ has only two trivial idempotent, But $M_2(F)$ has infinitely many nontrivial idempotent. you could find this point at exercise [11.b] page 443 of Hubgerford. So I think you should determine the property of your ring$R$ which entries of matrix ring come from it. $\endgroup$ – Ali Reza Nov 26 '12 at 5:59

$\begingroup$ Ok. But in local ring we have no problem. See Lemma 7 in the paper Journal of Algebra 301 (2006) 280–293, when is 2x2 matrix ring over a commutative local ring are strongly clean. $\endgroup$ – Ali Nov 26 '12 at 9:19

$\begingroup$ Dear friends. Let me ask my quedtion in another case. If $J$ is an ideal of $M_{n}(R)$ then there is an ideal $I$ of $R$ such that $J=M_{n}(I)$. Now, if $J$ is generated by a subset of idempotent of $M_{n}(R)$ say $S$, does $I$ is generated by a subet of idempotent of $R$ relatesd to $S$. $\endgroup$ – Ali Nov 26 '12 at 10:37