You can turn off specific iCloud features, or iCloud as a whole, on most Apple devices and on a Windows computer.
It's easy to log out of Gmail on your iPhone by removing your Google account from the device. Here's how to do it.