How to change my message settings on my iphone 4?

If I get a message you can see it in my lock screen, but someone told me that I can hide it and it just comes up with the sender and 'message'.
How do I do it?

In the messaging department of setting there's a clear option to hide this.

Hope this helped.

See here
http://www.iphonefaq.org/archives/97350

General -> Notifications -> Messages
Turn off 'Show Preview'

or google for more using
"change iphone message notification locked"

I updated to ios 7 and my messages don't come up on my screen when my phone is locked