Apple has not released iChat for the iPhone yet. You can get IM via Safari using a site like Meebo (there are a few others out there). It works well, but it is constantly refreshing itself so it knows when you have a new message. It's fine for a few quick IMs. I gotta figure that it sucks up battery life quickly.
The alternative is to use 1 of the two 3rd party IM apps: ApolloIM or Mobile Chat. If you're on firmware 1.1.1, there's a fairly involved process for jailbreaking the iPhone and getting AppTapp working again. That would allow you to run 3rd party apps.
Hope this helps.
--DotComCTO