By following the following IRC Gitter guide:
/server add gitter irc.gitter.im -ssl -ssl_verify -ssl_dhkey_size=1024 -password=
/connect gitter
You get your token in this website. You log in and copy-paste the token with the password above. However, please note that it is very important to specify the nick as well. Otherwise, you could connect to Gitter but the service will throw the following error:
irc: reading data on socket: error 0 (connection closed by peer)
In order to avoid this problem, specify the nick:
/set irc.server.gitter.nicks "YOUR_NICK"