Introduction
This is a claim that has persisted for a long time, and though people who believe in the 2012 stuff have propagated it, it is not specifically a Planet X / 2012 claim: If all the planets (plus our moon) lined up opposite the sun, they would pull us out of orbit. As the “lolcatz” say, “Oh noez!”
Gravity
The force felt by an object due to gravity is a very simple mathematical function, codified by Newton’s Universal Law of Gravity:
In this equation, F is the force felt, G is the Gravitational Constant, M m are masses of the two objects in question, and r is the distance that separates them.
To figure out how much more or less two different objects will pull on the same object, we can simply remove one of the two masses, so the equation simplifies to F = G * m / r^{2}.
The Math
To determine the relative forces, one simply needs to know the mass of the planets and sun, and the distances between Earth and those objects. This can be found in any basic astronomy textbook or online source. One then can simply plug in the numbers and figure out the forces.
For the sake of argument, let’s say the sun is on one side of this tugofwar, and the moon, Mars, Ceres, Jupiter, Saturn, Uranus, Neptune, and even Pluto are all on the other (Venus and the sun don’t count ’cause they would have to be on the sun’s side). Let’s calculate the force first due to the sun:
Object

Mass (10^{24} kg)

Distance from Sun (10^{6} km)

Distance from Earth (10^{6} km)

Relative Force

Sun  1,989,100  —  149.6  0.0059 
Alright, now let’s do all the rest, remembering that for the planets, we’ll need to subtract out the distance between Earth and the sun from what are commonly quoted as the planets’ distances:
Object

Mass (10^{24} kg)

Distance from Sun (10^{6} km)

Distance from Earth (10^{6} km)

Relative Force

Moon  0.07349  —  0.3844  3.32·10^{5} 
Mars  0.6419  227.9  78.32  6.98·10^{9} 
Jupiter  1,899  778.6  629.0  3.20·10^{7} 
Saturn  568.5  1434  1284  2.30·10^{8} 
Uranus  86.83  2872  2723  7.82·10^{10} 
Neptune  102.4  4495  4345  3.62·10^{10} 
Pluto  0.00125  5906  5756  2.52·10^{14} 
Ceres  0.00095  415  265.4  9.00·10^{13} 
Final Thoughts
This is a really short post because it doesn’t need to be long. To be perfectly honest, I was actually surprised at how small the force of Jupiter actually is on Earth relative to the sun. If we add up the force from all of the other objects, we only get a force that is 0.566% as strong as the sun’s. And then if we take the moon out of the equation because that would be the first to move out of the alignment, then we have a force of only 0.000592% as strong as the sun’s.
If we look at Venus if it were also lined up, helping the sun, its force is 1.90·10^{7}, or about half as much as all the other planets (again, leaving out the moon), so it would cancel 54% of the effect of all those other objects (again leaving out the moon). The force from Mercury is only about 1/3 that of Mars.
So really, if anyone who makes this claim were to bother to spend about 10 minutes looking up the numbers and plugging them into an Excel equation (what I did), they would quickly see that this claim is simply and utterly nonsense. And this is besides the fact that the planets aren’t lining up any time soon on the other side of Earth to try to pull us out of orbit.