Star Trek chose torpedo because Gene used navel terms for everything. Many that follow the Air Force to space progression use missile. If you don't do something to make them different, they are both the same. Well, there might be one technical difference. A torpedo would always be launched from a tube. A missile may be launched from a tube or an external mount. Otherwise they are the same. Here is an example of a manufactured difference:
If a system uses both, a torpedo could be a wire guided system where it has a certain distance before it is off guidance and working with its last commands. Then, in contrast, the missile would use some other form of guidance right from the get go. This makes the missile more prone to issues where something spoofs or blocks that guidance. The torpedo, in contrast, has a huge length of fiber spooling out that will be added mass and eventually lost with each shot.
If it has no guidance, it is a rocket or a slug of some sort. The difference being the continued propulsion a rocket has. Hard fired rockets can have a nice stealth aspect. Say a rail gun to get the rocket out there at speed but low detection of firing location. Then, it uses propellant to get more speed to do more damage with the increased velocity. Tracking the rocket back to ignition will not show the location of firing in that sort of hard launch system.
The same sort of launch propellant could be used with the missile or torpedo. That leads to another difference that could be built in. The missile tends to go hot right when it is launched. A torpedo can be sent out slowly, saving fuel, and make a stealth approach. Then, when in a good firing solution, make speed under its own power.