Scandinavia is a dialect continuum, so I normally talk about it as one language. Most people don’t, but that’s fine too. Lets look at the names “Norwegian”, “Swedish”, and “Danish”. They have two main meanings, descriptively:
1. Any and all Old Norse-derived varieties spoken within the political borders of the respective Scandinavian countries.
2. The main Old Norse-derived variety used in the respective Scandinavian countries (roughly Oslo, Stockholm, and Copenhagen speech).

Basically, they are terms of convenience. If you’re a learner, you’ll probably use it more in the second meaning, so I’ll do that here, but don’t forget that Scandinavian is more than these three (four if you count Nynorsk) standards. All the standard varieties are really similar to each other, and one common way of saying it is that Norwegian and Swedish sound similar (Oslo being close to Stockholm geographically), whereas Norwegian and Danish look similar in writing (Bokmål being based on the Danish written tradition).

There’s a lot of truth to this, and with Oslo being a place where all kinds of Norwegians and other Scandinavians alike can be heard, learning Bokmål (the most popular written language in Norway) with Oslo pronunciation is a good way to access Scandinavia from the middle. Norwegians are generally better at understanding their neighbours than the other way around, which may have something to do with being in-between. I personally think Oslo-accented Bokmål gives the best coverage overall.

Varieties of Language

The terms ‘language’ and ‘dialect’ (and, indeed, ‘variety’ – a very handy term that encompasses ‘language’, ‘dialect’, ‘register’, and so on) are nothing more than terms of convenience and a reflection of culture. They are not scientific terminology. The reason for this is that it’s impossible to determine by objective linguistic criteria whether we’re dealing with one or two varieties – and that goes on all levels (even the individual). An excellent in-depth discussion of why this is so can be found in “Sociolinguistics” by R. A. Hudson.

‘Dialect’ has roughly two descriptive (as opposed to prescriptive) meanings:
1. “Variety of a certain language.”
2. “Non-standardized/non-official variety.”
(For the second meaning, a ‘language’ is then “standardized/official variety” – but a better term is simply “standard language”.)

The first meaning tends to be preferred by language enthusiasts, but it’s a lousy definition, since it’s impossible to determine what a ‘language’ is, and thus also what a ‘dialect’ is. The second tends to be hated by egalitarian-minded people because ‘language’ comes with a certain prestige that ‘dialect’ doesn’t have, but at least it makes it possible to distinguish the terms without ambiguity.

Whenever this question comes up, someone with the first definition in mind mentions mutual intelligibility as a definitive measure that can help us decide. However, mutual intelligibility is not only highly gradual; it also depends heavily on one’s previous exposure and will to understand, and so doesn’t help.