I am wondering whether some criterion can be put on a category $\mathcal{C}$ with direct sums to ensure that for three objects $X,Y,Z$ one has $$ X\oplus Y \cong X \oplus Z\Longrightarrow Y\cong Z. $$ For $\mathcal{C}$ being the category of finitely generated abelian groups this is certainly true, and this is also true for arbitrary abelian groups when $X$ is finitely generated by a theorem of Cohn and Walker. In the case that $\mathcal{C}$ is the category of $\mathbb{Z}[G]$-modules, where $G$ is a finite group, this property is discussed at length in Richard Swan's paper Projective modules over binary polyhedral groups J. Reine Angew. Math. 342 (1983), 66–172, MR0703486.
I would expect some formal criterion at least to exist, even if it may be relatively hard to check or to apply. Of course, the more useful and easier to apply, the happier I am!