Is there such thing? I use AIM and I have to keep the app running to be online. Is there an app that I can close and do other things and still be online?
At the moment, no- no third-party apps are allowed to run in the background on the iPhone at the moment assuming you're not using a Jailbroken phone & Backgrounder.
The closest any of the IM clients can get is to keep your account online via their servers and then send you an email or text message when a new message comes in. BeeJive does this as I believe do several of the other paid ones (I've only really used BeeJive, so I can't speak accurately to the others...). BeeJive is a bit on the expensive side as far as apps go, but it's well worth the price in my opinion (and that of most people I've seen talk about it).