All messages are gone once you close the window, unless you choose save messages in preferences/options.
The new versions also give you the last few lines when you talk to someone again, if you have saving enabled.
So say you were talking to Bob about his car.
When you talk to him the next day, you will see the last ~5 lines between the two of you in the new (otherwise) empty window, so you know where you left off.
This is especially convenient if someone sends you an offline message (they pop up when you sign in next, by default)
Rather than a message of "Haha, I loved that, it was awesome"
leaving you wondering what they're talking about, you'll see the lines you wrote above it as well, like "Did you see the latest episode of last comic standing?".