Changing my comment to an answer as it pretty much answers the question.
The definition of "torpedo"
Looking up the definition of the word "torpedo" nets the following result:
A cigar-shaped self-propelled underwater missile designed to be fired from a ship or submarine or dropped into the water from an aircraft and to explode on reaching a target
In other words, a torpedo is nothing more than a missile that's designed to travel in water, rather than through the air.
The other answer argues that it's the intended target that defines the distinction between missiles and torpedoes, but that seems wrong. This seems to be a case of correlation and mistaken causation.
In aquatic combat, there is not much to shoot at except for ships. Therefore, torpedoes can only really be fired at ships, in absence of any other meaningful target. That does not mean that the definition of a torpedo therefore requires it to be shot at a ship.
Similarly, just because all basketball players in the NBA wear shoes when playing a game, does not mean that it's a rule that players must wear shoes. They all just choose to wear shoes in absence of a good reason to not wear shoes.
But why do they call some space missiles torpedoes?
Space-based combat is much closer to aquatic combat than it is to land combat. We speak of spaceships, not spacecars or spacevehicles or ...
This is pretty much entirely encapsulated by the Space is an Ocean trope. (TV Tropes warning!)
Maybe it's the romance, maybe it's the adventure, maybe it's the obvious parallels to the Age of Exploration, but for some reason, when people write about space, they tend to make parallels to the sea, as President Kennedy (himself a former naval officer) did in his "Space is the new ocean" speech. Often, it goes far beyond metaphor. Science Fiction writers frequently use nautical analogies for pretty much everything in space, and fill in the gaps in their own knowledge about spaceflight with details specific to sea travel.
To some extent, Space Is An Ocean is a Justified Trope: not only was space thought to be some kind of fluid until the turn of the 20th centurynote , but seafarers long ago evolved the organizational techniques necessary to safely operate a self-sufficient vessel in a potentially hostile environment for an extended period of time, and it makes more sense to adopt nautical administrative and logistic features (and the terms for them) instead of inventing everything from scratch.
I won't list all examples (that's what the link is for), but some do stand out as commonly accepted space tropes:
- Space militaries almost always use naval ranks, as opposed to army ranks or the RAF system, and soldiers stationed in space are usually called "marines", e.g. the "space marines" of Aliens, Doom, Marathon, StarCraft, etc. Starship Troopers did not call its soldiers marines though it could be argued that it established the archetype for later space marine forces. Even in real life, space explorers are called "astronauts" and "cosmonauts".
- Spacecraft even have "lifeboats"—generally called escape pods or something similar—despite the concept being largely impractical in case of realistic space travel.
- In space, hovering things have to move up and down slightly. (Note: this refers to making the scene believable for the viewer, rather than being physically sound)
It even makes more sense when you compare submarines (not just boats) to spaceships:
- Both move in three dimensional space.
- Prolonged exposure to space (or water...you get it) outside the vessel can be deadly (if the sub is currently at depth).
- Visual displays of the outside environment are less than useless (both space and the briny deep are inky black).
- The torpedo analogy works better as well.
Conclusion
Why are space missiles called torpedoes?
Because it's a common trope to use naval terms for space-travel, due to the similarities.
So they are torpedoes. But why do they also call them missiles in Star Wars?
Going by the definition I linked above, a torpedo is an underwater missile. Therefore it would be correct to call a torpedo a missile.
All torpedoes are missiles, but not all missiles are torpedoes.
Regardless, since it's accepted to refer to space missiles as torpedoes, that inherently means that it's also correct to call them missiles.
So to answer your question directly: In regards to Star Wars and other forms of space combat, all missiles can be considered torpedoes, and all torpedoes can be considered missiles. There is no meaningful distinction between the two.