Recently I implement the GCM on my app. I followed the tutorial code at this website
http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifi
WhatsApp doesn't rely entirely on GCM (I'm not sure if it relies on GCM at all). If you open your Android device's Settings and go to Applications and then Running services (the menus may be a little different if you are using a different Android version than I'm using, which is 2.3.6), you'll see there's a WhatsApp service running in the background (assuming you have WhatsApp installed). If you stop that service, you would stop receiving messages from WhatsApp until you launch that app again.
Your app can accept GCM broadcasts only as long as you don't kill it explicitly. Once you kill it, it won't receive any broadcasts until the next time you launch it (according to what I read, that has been the case since Android 3.x). If, however, you move your app to the background (for example by launching another app or hitting the back button until you move to the home screen or to another app), your app would still get messages from GCM.