The message history will be saved on the server up to 30 days back, which you can request to download if you need them. On the device, it will save up to 1000 messages. Old messages are periodically cleared.