How to block unwanted apps from accessing internet in Android

It works the same way you do it in your PC.

Get a firewall!

Go to Google play and search for firewall. Install a suitable firewall of your choice like, Droidwall.

From that things go self explanatory. Just open the firewall app and configure which apps can connect to the internet.

Note that, your device needs to be ROOTED in order to use firewalls.