You purchases are linked to your Google or iTunes account depending on the store from where you have made the purchase. So if you change or reset your device just login to your account and download it again without paying
For iOS users, you need enter the store page and click on the restore button located at the top of the screen.
If you have purchased on Google Play and want to restore it on iOS then that is not possible. Same goes for Apple App Store.