Spam is unsolicited commercial email.
It is important that the message be both unsolicited and commercial in order for it to be classified as spam. Many definitions of spam also include the word "bulk"; that is, that the email must be sent to multiple recipients to be considered spam. In practice this distinction is probably not worth making because basically all spam that is classified as such for being unsolicited and commercial also satisfies the "bulk" criterion.
Someone sends you an email you don’t want
Merely because you aren’t interested in or don’t want a message doesn’t make it spam. For example: a request that you do an onerous favour isn’t spam, email from someone you dislike isn’t spam, and so on. The only considerations that matter are the questions "is it unsolicited?" and "is it commercial?".
Someone you don’t know emails you out of the blue
Again, this is unsolicited but if the email has no commercial intent then it’s not spam (whether you know the person is irrelevant).
Someone sends you a chain letter
Merely being "bulk" doesn’t make something spam; once again we must apply the unsolicited/commercial tests.
A company from which you’ve purchased something sends you a "newsletter"
Even if the email doesn’t contain explicit offers to sell you anything it’s still commercial because its purpose is maintaining a relationship with a customer in the hope of cultivating future sales; in this case the deciding factor is whether or not the email is solicited. Did you ask to be added to their distribution list? Did you leave the "please keep me up-to-date" checkbox checked when you went through their checkout?
A company from which you purchased software advises you of a new version
If the new version is not a free upgrade then the purpose is clearly commercial. If, however, the new version is free and includes bug and security fixes then the company could argue that the purpose is actually a moral one (ie. to protect your machine from harm that might be caused by the buggy software).
As this is a grey area the best policy is for companies to not send this kind of email unless the customer has solicited it. There are plenty of other channels through which customers can be aware of such updates — feeds, press releases issues to news sites, and more — so it is not like companies must depend on mailing lists in order to fulfill their "moral" obligation of notifying users about fixes.