Assuming it's an app doing that (which is not unlikely), you'd first need to identify which app that might be. Uninstalling all of them would be a bit hard, so let's try a different approach – and narrow down the candidates.
To be able to change your device's network state, that app would need specific permissions. Which are CHANGE_WIFI_STATE for WiFi resp. CHANGE_NETWORK_STATE for your mobile data. So check your installed apps for those having that permission. You can do so by looking up each of them in the "my apps" section of Google Play – or you use a Permission Checker.
There's e.g. Permission Friendly Apps, being very permission-friendly itself (requiring not a single one). It presents you with a list of all your installed apps, and even marks them according to their "permission-friendlyness". Tapping the entry of an app reveals its permissions.

Permission Friendly Apps and aSpotCat inform about permissions your apps request (click images for larger variants)
Better suited for our purpose here is aSpotCat. As you can see in the screenshot, it lets you browse apps by permission – perfect to find your candidates.
Once you've narrowed down the list of installed apps to those having the necessary permissions, check that for apps you've recently installed or updated (i.e. just before the trouble started). Hopefully that leaves as few candidates as possible, best only one. Those you need to get rid of, at least temporarily, one by one – until your trouble ends. The last app disabled must be the one having caused the issue.
Before "kicking it" completely, check its settings. Maybe it was just a new feature introduced, and you can turn it off. If not: the app stores are full of alternatives, watch out for those. And take care of permissions before installing one of those ;)