which is better the 5W or 10W

And what is this 30 and 40 after that.

What i mean is 5W-30, 10W-30, 5W-40, 10W-40.

The dealer said that 5W is not thick enough, and it has to be 10W.