Chatting with what tool? Are you referring to an IM conversation?
There are many different ways you COULD do it, depending upon the service you're using for IM, etc. You could, for instance, pass a graphic with some embedded code to run ipconfig on the other person's machine, and send you a result, etc. Or you could, as easily, pass them a url to a local server of yours, and have them click it, then have the server logging the connections etc. Many ways, but it all depends upon the situation, etc.
By default, however, I don't think most of the reliable IM vendors (such as GMAIL IM, AIM, etc) have a pre-built mechanism for allowing you to log the IP of the user you're chatting with.
~ hayabusa ~
"All men can see these tactics whereby I conquer,
but what none can see is the strategy out of which victory is evolved."
- Sun Tzu, 'The Art of War'
OSCE, OSCP (Former - GPEN, C|EH - both expiring / expired)