We can't give a general answer here: While you can simply switch with Apple, Google makes it a little more difficult:
Google Play Store
You can change your app from paid to free.
Once your app has been offered for free, the app can't be changed to paid. If you want to charge for the app, you need to create a new app with a new package name and set a price.
You can change your app from free to paid - people who have already installed the app can continue to use it, if you reinstall (or re-install) the app you will have to pay for it.
You can also change your app from paid to free - previous buyers of your app will not see any difference, for new users the app will appear in the AppStore as a free app.