As Damiano pointed out, if a smooth projective $X$ surjects onto a curve, and $\dim X>1$ then the Picard number is at least $2$. This gives a clear obstruction, which explains why $\mathbb{P}^n$
won't satisfy it (when $n>1$). In fact, by refining this using Chow groups in place of the Picard group, we can see that  $\mathbb{P}^n$ won't map onto any variety of smaller dimension
for similar reasons . On the other hand,
$X$ will map onto $\mathbb{P}^1$ after blowing up, as Charles observed, and this is often
a very useful trick in practice.

The case of (`*`) $X$ mapping  onto curves of genus two or more is actually something that has been studied a number of people Amoros, Beauville, Catanese, Bressler, Ramachandran,
Gromov, and me (I'm sure sure I'm leaving someone out, my apologies in advance, but I tried).
From Castelnuovo-De Francis (see Damiano's answer) one can extract a number of topological criteria. Here's one: $X$ satisfies (`*`) if and only if the fundamental group admits a surjective
homomorphism onto the fundamental group of such a curve.
Some of this probably described in the multi-author book on Kaehler groups.
Also take a look at my  <a href="http://arxiv.org/abs/math/9204225"> note </a> in the
Bulletin from way back in the last century.