How to Hide Lock Screen Notifications on Stock Android

Open Settings > General. Tap Apps & notifications (or Sound & notifications in older versions of Android). Tap Notifications > Lock screen. Tap Hide sensitive notifications only or Hide all notifications. To make notifications visible again, repeat the steps above and tap Show all notifications.

How to Hide Lock Screen Notifications on Samsung and HTC

For some Samsung phones, such as the Samsung Galaxy S6:

Open Settings. Tap Lock screen. Tap Notifications. Tap Hide content or Notification icons only. To hide or show notifications from specific apps, scroll down and tap Show notifications from. Tap the switches to toggle notifications for individual apps.