Hi,
iMessages account on the Mac (in the Messages app) stores the iMessages in a Chat.db item
IF you dismiss a conversation from view (mouse over it and use the x that appears) the chat.db will supply the "History" if and when you contact that person again.
However it is worthwhile also creating a back up of some sort.
As well as Time Machine it can also help to highlight the whole Chat (work from the most recent end to the "top" of the conversation to highlight it all.
You can then Print and Save as PDF.
You can back up your iPhone in iTunes.
These can be used to Restore the iPhone back to that time. (you do lose all new things added since the Backup was made.)
There are various tools out there to extract info from iTunes Backups of iOS devices, which might help.
Of course the Messages app on the Mac also has a Settings for Saving on close. (it will Save if you dismiss the chat/Conversation and when the app is closed/Quit)
Over and extended conversation or chat that lasts days or months each Session on the computer is Saved.
Again you can dismiss the chat/conversation form view as you have saved versions (in parts) of the conversation.
(You cannot Save a chat or conversation in Retrospect.)

8:42 pm Sunday; October 5, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad