I have an HP printer and I set up HP's free Mobile Printing.
You can go into Messages, open the SMS or iMessage thread you want to print. Then, choose Edit, select the conversation item(a), then select Forward and send them to the email address associated with your printer, and they should print.