Yes. An SSL connection provides confidentiality and integrity of the transmission: an adversary (someone who is neither of the two communicating parties) cannot find or check what data was transmitted, and cannot modify the transmitted data. The adversary cannot replay data either.
With respect to confidentiality, note that an adversary can observe which machine is connecting to which machine when, and how much data is exchanged. This means that although the adversary cannot know the content of the messages, they may be able to guess who is talking to who. Privacy requires additional precautions.
With respect to integrity, note that it relies on authenticity. Integrity guarantees that when Alice is talking to someone, nobody except Alice and that someone can modify the data that they're exchanging. But if Alice wanted to talk to Bob, it does her no good that she can have unmodified communication with an unidentified party: she needs to know that she's having unmodified communication with Bob. TLS is a client-server protocol and always guarantees the authenticity of the server. It can optionally guarantee the authenticity of the client.
Beware that TLS versions up to 1.2 have some unusual cipher suites with reduced security guarantees. While the default configuration of all major TLS libraries disable those cipher suites by default, you do need to be careful not to accidentally enable them. TLS 1.3 only has full-security cipher suites (noting that client authentication is still optional, since TLS is designed to support unknown clients connecting to known servers).
Finally, keep in mind that TLS can only provide security guarantees about the transmission. It's difficult for two random machines on the Internet to communicate directly, so chat typically transits via a central server. If you only rely on TLS between each client and the server, TLS secures a message while it's in transit between client 1 and the server, and when it's in transit between the server and client 2. But it's up to the server software to guarantee the security of the message in between — for example, that the message is routed to the correct recipient. There are more sophisticated protocols that can guarantee end-to-end security of messages, a popular one being Signal. Applications that use such protocols may still use TLS between hops. This can, for example, help privacy by hiding from eavesdropper the information of who is talking to who, or help against spending resources on routing fake messages that would otherwise only be dropped when they reach their intended recipient).