Obviously it's not a great idea for just anyone to be able to pick up your phone and see your notifications on the lock screen. Unless you're the world's most open person who also never, ever texts about anything embarrassing, weird, or private.
The option for configuring this is within Settings > Notifications, and it's labeled "Show Previews."
There are three choices: "Always," "Never," and "When Unlocked." "Always" obviously isn't great unless you want anyone who has your phone to be able to see whatever notifications you're getting. But "Never" is annoying, too, because that'll mean that you have to physically open the app in question (like Messages) in order to read what the notification is about. You'll still see that Some Random Person sent you a text, but you won't know anything else about it without opening the app. Ugh.
So the happy medium there is "When Unlocked," which'll mean that you can view your notifications both while you're using the phone and on the lock screen if it recognizes your face or fingerprint. Neat!
And just so you know, your Mac has a similar setting to block your notifications from being read unless it's unlocked. That option is available at System Preferences > Notifications. If you click on any program within that list, you can do one of two things. First, you could have that app not show anything at all without your permission by unchecking the "Show notifications on lock screen" box. Or you could instead check the "Show notification preview" box, and that will give you a new drop-down menu with the choices of "always" and "when unlocked."
I note that GarageBand is allowed to send me notifications. Huh. Has anyone in the history of the world needed GarageBand's notifications on?
Yeah, I thought not.