With telnet, every time you connected it told you the escape sequence (^] usually) that would let you shell out to the telnet command prompt to disconnect or whatever. With ssh, I've never known how to do this.
Apparently I'm not the only one... but if you bother to read the man page, the function does exist:
$ ~?
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections