The answer is yes in the category of groups. Suppose that $f: G \to H$ is a retraction with $G$ a free group. Then there is a homomorphism $g: H \to G$ such that $fg = \mathrm{id}_H$. Thus $g$ is injective and hence embeds $H$ isomorphically as a subgroup of $G$. But any subgroup of a free group is free, so $H$ must be free. The same proof works in the category of abelian groups also.
Edit: the same proof will work anytime you have the theorem that a subobject of a free object is free, I think. I don't know if that is true in the other categories that you mention.
Further edit: this property can fail even in very nice categories. For example, let $k$ be a field and consider the matrix algebra $M_n(k)$. In the category of finitely generated modules over $M_n(k)$, $M_n(k)$ itself is a direct sum of $n$ copies of $k^n$, but $k^n$ is not free over $M_n(k)$.