When a text message arrives the iPad displays it on the screen by default, even if your device is locked.
To keep messages from prying eyes, open Settings, Notifications, then Messages. Press Show Previews and you’ll be able to choose from three options: Always is the default choice, while When Unlocked will hide text previews from the Lock Screen and Never will hide text previews at all times.
This is also possible for email messages. Open Settings, Notifications, then select Mail and follow the above steps. Now, neither text or email previews will appear on your device when received.
You’ll find similar options in the settings for third-party messaging apps like Facebook Messenger and WhatsApp.