Depends on the app you're using, but most should allow you to do it as long as you didn't block it in the Notification settings. From the app you're using for Messages, tap and hold and 'drag' to the Info icon, find the Notification section, and see if the preview and show in lockscreen options are active.