How do in-app purchases work? I'm trying the free version of an app, and I'm considering to upgrade to the Premium version. The said app is Rewire.

From what I see, the Premium version in not directly available on Play Store, and it can be purchased only in-app.

How do these purchases work? If I  uninstall the app then reinstall it later, or if in the future I change my phone, this purchase will still be recognised?

Will I be able to use the full version again without having to pay once more for it? 

It appears that the purchase is managed by Google Play:
There are two kinds of in-app purchases &mdash; managed, and unmanaged.  The former have more direct involvement from Google and are transferrable between installs.

Managed purchases are generally for things like premium/pro versions and subscriptions, whereas the latter are for one-off purchases.  Unmanaged ones might cover extra donations or things like virtual currency.

So as long as the developer has implemented the right kind of purchase, you should be fine.  If not, and the transfer doesn't work, I would expect that an appeal to Google would result in a prompt refund.

See http://www.androidauthority.com/android-inapp-purchases-need-know-92432/