Where it gets confusing is when nationalism gets involved. Mandarin and Wu are different "dialects" of the same "language" because they're from the same country. Italian and Spanish are different "languages" because they're from different countries. It's a political distinction.
Linguists tend toward using mutual intelligibility as the difference between a language and a dialect, but it's fuzzy. Beijing and Shanghai dialect are almost totally mutually unintelligible, but if you walked from Beijing down to Shanghai, each village, town, or city you pass will speak a dialect that's still mutually intelligible with the immediately neighboring village/town/city's.
But really, the words "dialect" and "language" mean essentially the same thing in English.