The chats are encrypted and stored encrypted on the cloud, but they have access to the key. If they didn't have access to the key they couldn't allow some of the functionality that people want like being able to see the chats from different devices. Telegram has secret chats too which are e2e encrypted and don't store anything on the cloud.
They are probably encrypted in the backend DB with a symmetric cipher on the server with a key that Telegram have access to.