Whenever I log in to stackoverflow, It has my username and the opportunity to log-out.
But as soon as I click the chat link, the user name changes to some other user name, and worst of all, there is no logout option.
What can I do?
You can log out at http://chat.stackexchange.com/logout. The Stack Overflow chat needs no logout link, since you can just log out of Stack Overflow and will be logged out of chat automatically, but the Stack Exchange chat login isn't tied to a particular site, so that doesn't work.
We should probably show this link somewhere on http://chat.stackexchange.com; the functionality is there, but you're right, it's not really exposed anywhere.