To help prevent lost progress, Terraria is designed to auto-save every 5 seconds. We also recommend using the cloud save feature for your characters and world in case something happens to the local storage on your device.
To further ensure that you don't lose your characters or worlds, we highly recommend that you not leave Terraria suspended in-game. When you are done playing, press Pause and then select "Exit to Main Menu". Then from the Main Menu, press the Back or Home button on your device and select "Yes" on the Quit screen that appears if applicable.
This is the best way to help ensure that your game is properly saved and closed each time!