Well, client-side, you can press F1 to turn off the whole HUD, but then you can't see your hotbar or health or hunger or XP...
If you're running a server, then check for an option. If there's not one, then maybe search for a plugin.
On local servers, (choose "Open to LAN" on the ESC screen in single player to start one,) one of the options is to disable chat.