In what generality does the second argument of Hom distribute over tensor?

Let $R$ be a commutative ring, and let $M,N,P$ be $R$-modules. In what generality can we say that $Hom_R(M,N\otimes_R P)\cong Hom_R(M,N)\otimes_R Hom_R(M,P)$. This is true in a cartesian monoidal category, and from that, it seems like we might be able to force it if all of the modules are free (look at basis-to-basis mappings and distribute the Hom first), but do we need any finiteness conditions? Do we need freeness at all?

-

This is not true even if all the modules are free; let $R$ be a field, let $M, N, P$ be finite-dimensional, and compare dimensions. (It is true if $\otimes$ is replaced with $\oplus$; this is because $\oplus$ is both a finite product and a finite coproduct.)

The tensor product is not a Cartesian product, and in this sense it does not even behave like a Cartesian product. The sense in which it does behave like a Cartesian product is the adjunction

$$\text{Hom}_R(M \otimes_R N, P) \simeq \text{Hom}_R(M, \text{Hom}_R(N, P))$$

where $\text{Hom}_R(N, P)$ is the $R$-module of all $R$-module homomorphisms. This is analogous to the adjunction

$$\text{Hom}(M \times N, P) \simeq \text{Hom}(M, P^N)$$

in $\text{Set}$, where $P^N$ is the set of all functions $N \to P$. This and the hom above are examples of "internal homs," and if internal hom has a left adjoint it defines a notion of tensor product which does not necessarily have to behave like a Cartesian product; when it does, you might be in a topos, and the category of $R$-modules is not a topos but an abelian category.

-