With the evolution of the internet, the terms have become a little muddied.
When we think of "the web", we generally mean anything that can be accessed and consumed by a web browser. That isn't to say that is the only means for accessing it - look at Twitter and Facebook. A web browser might not even be the best way to access these services. But as the comments point out, you can access FTP via a browser and some browsers let you IRC and other traditionally non-web protocols.
And consider services a like WhatsApp - which originated as non browser services, but browser access was added later. The service is the same, but the means to access it alters over time.
So we might drop to protocol, and say "http" bases services are part of the web. But many aren't. http is such a ubiquitous protocol that I wouldn't be surprised if there are more non-web users of http than users of it.
Even SMTP might get encapsulated inside an HTTP service for a portion of its journey - it certainly doesn't become "web" at that point.
To clarify one point in the question - the use of www
in a DNS name is meaning less. It conveys nothing about the service on the IP address it resolves to and is not a standard of any kind. It is just tradition to use it for websites, but there is nothing to stop it being used as a ftp, message, smtp or any other service.
So my answer is there is no hard and fast rule to describe what is the web part of the internet and what is everything else. Internet based services might be accessible via traditional web protocols using traditional tools, and they might not, and they might change over time. It is just the internet now and internet services are exposed via various and multiple protocols and access methods.