TCP/IP is a protocol (agreed symbolic method for two computers to talk to each other across a network). The protocol admin allows for 65536 different "channels". E.g., normally, your webbrowser surfs on channel 80, and any mail to your mail server will be sent via channel 25 (SMTP), and received on channel 110 (POP3). These are common, "predefined" channels.
(Try logging into a web-based mail system like Yahoo, and selecting "Secure logon", or even paying for something on Amazon. You will notice the address bar changes from "http://" to "https://". This is a channel change from 80 to 443.)
The IM client will be using its own, proprietary channels (one in and one out). You just have to find out what they are, and tell your firewall. (It is possible on most applications to change the channels for added security.)
Does that help?