Is there a way to disable GPS if not in use by any app – either provided by Android itself or, if that's not possible, by use of a third-party app?
As Aleks pointed out, GPS only "drains battery" when accessed – its battery use in standby is negligible (see my answer here for some statistics). You can see whenever some app is accessing it, as then the cross-hair GPS icon appears in the notification bar.
However, some (badly coded) apps might be "hammering" GPS for location details. If you encounter such an app (but cannot live without that particular one), there are some automation tools which can take care for that (see e.g. our tasker tag-wiki) – and e.g. turn GPS of as soon as that "waster" starts, or after a delay of say 1 min to allow it for one fix and not more.