This principle (for nonempty sets, to avoid a trivial counterexample) is equivalent to the axiom of choice. One direction is in a previous answer. For the converse, let $X$ be an arbitrary set (which I want to well-order). Apply Hartogs's theorem to get an ordinal $\alpha$ so large that it cannot be mapped one-to-one into the power set $\mathcal P(X)$. Then $X$ cannot be mapped onto $\alpha$, because if $f:X\to\alpha$ were surjective then $\alpha\to \mathcal P(X):\beta\mapsto f^{-1}(\{\beta\})$ would map $\alpha$ one-to-one into $\mathcal P(X)$. So, by your principle, there is a surjection $g:\alpha\to X$. Then $X$ can be well-ordered by setting $x\prec y$ iff the first $\beta$ with $g(\beta)=x$ is smaller than the first $\beta$ with $g(\beta)=y$.