Is it always true that projective objects are retracts of free objects? I know that retracts of projective objects are always projective, so in particular, retracts of free objects are projective.
To prove the converse for modules, write your projecive module as a quotient of a free module, and then take its kernel to get a short exact sequence. This sequence splits because it ends with a projective object and so by the splitting lemma our module is a direct summand of the free module.
How to generalize these to an arbitrary algebraic theory? I guess we should somehow look at the kernel pair of the quotient map?
The argument for modules generalizes trivially, once you phrase it properly. For any object $A$, there is an epimorphism $p:F\to A$ from a free object $F$. If $A$ is projective, then applying the definition of projectivity to $p$ and the identity map $1:A\to A$, there exists a map $i:A\to F$ such that $pi=1$. That is, $A$ is a retract of $F$. (In the module case, you further conclude that $F$ is a direct sum of $A$ and the kernel of $p$, but this step is not needed.)
More generally, this shows that in any category, if you have any collection of objects $\mathcal{F}$ such that every object admits an epimorphism from an object in $\mathcal{F}$, then any projective object is a retract of an object of $\mathcal{F}$.