Telegram messages are encrypted at all times. Client-client encryption is used in Secret Chats, whereas client-server/server-client encryption is used in Cloud Chats, and messages are stored encrypted
on the Telegram Cloud (more here). This ensures that your cloud messages are both secure and accessible from any of your devices - even if you misplace your smartphone entirely.
In the end-to-end encryption paradigm, the problem of recovering access to your conversation history on a freshly connected device (e.g. when you lose your phone) does not have an elegant solution. At the same time, any mass-market messenger must have a reliable backup system. To address this issue, some apps (such as Whatsapp and Viber) provide decryptable backups, putting their users' privacy at danger — even if they do not enable backups themselves. Other apps ignore the need for backups altogether and leave their users vulnerable to data loss.