IM stands for Instant Messaging. It is a way to communicate. IM allows the user to create private chat rooms with an individual or many individuals in real time over the Internet. IM is mostly a text base communication but does still allow (depends on the service) voice communications. Instant messaging is instant unlike email or texting.
XMPP is a server that ranges throughout instant messaging, media negotiation, generalized XML routing, content syndication, white boarding, collaboration, and lightweight media ware. It was defined by RFC 3920 and RFC 3921back in 2004. People have built on top of those two specifications over the years and call it XMPP extensions. There is also SIP. It stands for Session Initiation Protocol. SIP initiates or starts a call or texting communication.