If I install something from Google Play, can I be sure it can uninstall itself? So recently bought an Android tablet, having first had an iPhone.

So with Apple's strategy, apps seem quite restricted. They can really only do a couple of minor things outside of the app (like notifications etc.) and they're also reviewed by Apple.

Android seems to allow a lot more freedom. You have apps that change the keyboard, or change the start up screen or allow you to share across apps etc.

So my question is... if I install something from Play Store, do I know that it will always uninstall properly? Do app developers actually need to write an uninstall program or is this done automatically in the OS?
Short answer
Generally, apps are cleanly uninstalled, and most if not all of their data will be removed along. Some exceptions may however apply to their data stored on sdcard, if any.
Detailed answer
Android uses a data structure which is defined by the developers API, and developers should stick to it. There are also not too many ways they could deviate, as e.g. file system permissions prevent this.
Aside from the .apk (the app itself) installed at a defined place, there are also defined places for the apps data: All these can only go below /data/data/&lt;package_name&gt; on internal storage (rare chances an app can access other places in internal storage to place its data, except from some &quot;temporary&quot; or cache locations. As for the sdcard, the API strongly recommends to use Android/data/&lt;package_name&gt; as corresponding place (see API documentation).
As long as developers stick to these rules, uninstalling the app will also remove all its data (as the system takes care for all those locations defined by the developer documentation, since these are easily identified via the package name). However, on the sdcard there are almost no restrictions which places an app can access (which is due to the FAT file system used for these cards), and some apps go wild here.