The W in the oil grade stands for Winter. The number before it, is the oil's Winter Rating. The higher the number,5 or 10 or 15,or 20 the thicker the oil is, and the LESS suitable it is for colder climates. The Lower the number, the better for cold climates. Where you live dictates what oil is best for your climate.
Where I live, I can use 15w40 or 10w40 or 20w50 however where I used to live, 5w30 was best or your engine would not turn over.
The number after the W is the Summer rating, and in that case, again based on where you live and what your temps are, the higher the number the thicker it is, the lower the thinner
Most car companies suggest 5w30 for all around use since it is also energy conserving because of it's thinness.
dross1958 makes some good points. Put a little more simply, though, 5w is thinner than 10w. 5w is good for cold weather, and 10w is good for older engines or for vehicles that expect to see a lot of freeway drive-time.