The chat history is stored within the app on your device. Thus, Your chat transcript will be kept permanently within the app on your device as long as the app is not removed and the phone has sufficient storage space.
This also means that when you switch to another device, your chat history will not automatically transfer over. To carry your chat history over to your new device, you must migrate the chat log using the Chat Log Migration feature in Me > Settings > Chat > Backup & Migrate Chats > Migrate Chats to Another Device.