Under what conditions does a quotient module $A/B\cong C$ imply the direct sum $A\cong B\oplus C$?

Suppose we have some finitely generated $R$-modules $A,\,B,\,C$ such that $A/B\cong C$. Under what conditions is it necessarily true that $A\cong B\oplus C$? Clearly the converse to this is true, but I was wondering if this is ever an if and only if? I would expect it to fail when we lose the condition of finitely generated but beyond that I am unsure.

This is precisely the extension problem for modules; if $A/B \cong C$, the standard lingo is that $A$ is an "extension of $C$ by $B$."
For fixed $B$ and $C$, the possible extensions are controlled by a group called the Ext group $\text{Ext}^1(C, B)$. The zero element of this group corresponds to the trivial extension $B \oplus C$ and the others correspond to nontrivial ones. The Ext group is usually nonzero so there are usually interesting extensions, even if $B$ and $C$ are finitely generated. The smallest example is $\mathbb{Z}_4$, an interesting extension of $\mathbb{Z}_2$ by $\mathbb{Z}_2$ in abelian groups.
A sufficient condition for $\text{Ext}^1(C, B)$ to vanish is that $C$ is projective or that $B$ is injective; in fact, more or less by definition (depending on what your definitions are), $C$ is projective iff $\text{Ext}^1(C, -)$ always vanishes, and $B$ is injective iff $\text{Ext}^1(-, B)$ always vanishes. For example, $\mathbb{Z}$ is a projective abelian group and $\mathbb{Q}$ is an injective abelian group.
If $\text{Ext}^1(C, B)$ vanishes for all $B, C$, then every $R$-module is both projective and injective, which is one of the equivalent definitions of $R$ being semisimple. This is a very restrictive condition, as the Artin-Wedderburn theorem makes precise, and very few rings satisfy it; the smallest counterexample is again $\mathbb{Z}_4$, but now regarded as a ring.
• Actually, it's possible for every extension of $C$ by $B$ to be isomorphic to $B\oplus C$ (as modules) even if $\operatorname{Ext}^1(C,B)\neq0$. – Jeremy Rickard May 10 '15 at 7:45
• Sure, it depends on what you mean by $A \cong B \oplus C$. The natural thing for this to mean is that $A \cong B \oplus C$ in a way compatible with the isomorphism $A/B \cong C$, and then you're talking about an isomorphism of extensions and not just an isomorphism of modules. – Qiaochu Yuan May 10 '15 at 17:31
• I agree that's a more natural question to ask. But I disagree that it's a natural thing for $A\cong B\oplus C$ (which seems pretty unambiguous to me) to mean. – Jeremy Rickard May 10 '15 at 19:08