@mewmew depends on the context - DM and PM are messages to a single user, IM is any sort of instant chat message regardless of if it's private or direct. A private message on Pleroma isn't an IM but it is a DM/PM, Pleroma Chat is both. A public Matrix, irc, discord, etc chat room is IM but not DM/PM.
DM and PM are interchangeable imo, I use both