Explaination of a justification: additive functors preserve limits 
Lemma: For any collection $\{ M_i\}_{i\in I}$ of $R$-modules, and $R$-module $N$, there is a natural isomorphism 
  $${\rm Hom}_R(\oplus_i M_i, N)\cong \prod_i {\rm Hom}_R(M_i,N).$$
Proof: Additive functors preserve limits. 

[Ref: this link, page 2.]

Q. The lemma also follows from the definition of direct sum of modules. However, the purely categorical justification given in above proof is not clear to me. Can one explain in detail the above proof? 

I just started study of homological algebra, so my vocabulary of this sunbect is not so deep. 
 A: If you know that the functor $T=\operatorname{Hom}_R(-,M):R\mathtt{Mod}^{op}\to \mathtt{Ab}$ preserves limits, then the result follows.  Indeed, the direct sum $\bigoplus M_i$ is just the coproduct of the $M_i$ in $R\mathtt{Mod}$ and thus the product of the $M_i$ in $R\mathtt{Mod}^{op}$, and so since $T$ preserves limits the natural map $T(\bigoplus M_i)\to \prod T(M_i)$ is an isomorphism, and this exactly gives the statement of the Lemma.
However, the justification given in the proof of the Lemma is totally wrong.  Additive functors do not always preserve limits, and so you cannot use additivity of $T$ to deduce that it preserves limits.  It turns out that $T$ does preserve limits, but you must prove this by other means (and given that the Lemma is just a special case of $T$ preserving limits, this doesn't actually make proving the Lemma any easier).
A: Here's a purely categorical approach when $R$ is commutative. (The proof below actually works for any symmetric monoidally closed category which $R\text{Mod}$ is in the commutative $R$ case.)
The internal (or external) Hom is continuous in both arguments. Since it's contravariant in the first argument, this looks like turning colimits to limits. For the external Hom, this is basically just the perspective of limits and colimits by representability, so it could even be true by definition. For the internal Hom, we need to be working in a symmetric monoidally closed category (with the monoidal closure as the Hom). The symmetry is important here. Symmetry gives us the adjunction $$\mathsf{Hom}^{op}(\mathsf{Hom}_R(N,P),M)=\mathsf{Hom}(M,\mathsf{Hom}_R(N,P))\cong\mathsf{Hom}(N,\mathsf{Hom}_R(M,P))$$ (natural in $M$ and $N$ [and $P$]) meaning $\mathsf{Hom}_R(-,P)$ is a right adjoint and thus preserves limits like all right adjoints.
