The title says it all.
A very similar question was asked and answered about linear groups, but none of the counterexamples are algebraic: Are extensions of linear groups linear?
If $A$, $B$ are affine and there is a rational section of $C \to A$ in $1 \to B \to C \to A \to 1$, then $C \to A$ is affine, so $C$ is affine. But if not?