If you’ve already updated your Mac to High Sierra 10.13.5, you’ll be aware that the one new user feature which Apple claims for it is Messages in iCloud, which recently came to iOS devices too.
As with those devices, it is not enabled by default. Once your Mac has restarted after installing the 10.13.5 update, to enable it, open Messages. There, open its Preferences, select Accounts, and select your iMessage (iCloud) account at the left. To enable this feature, tick the box labelled Enable Messages in iCloud. It should then sync automatically.
Those still running 10.13.4 or earlier don’t have this option. However, if Sierra users look in the more logical place to put this iCloud control, the iCloud pane in System Preferences, one of the apps listed in the iCloud Drive section there is Messages. According to the rubric given at the top of that pane, this makes Messages an app ‘that stores documents and data in iCloud’. That sounds very much like Messages in iCloud under 10.13.5, doesn’t it?
Unfortunately, snooping around using Cirrus doesn’t help here, as in neither case does Messages (or iMessage) have its own document folder. This means that Messages in iCloud operates using an app-specific database held in iCloud. So maybe we’ll never know whether the two systems work the same, or maybe that in Sierra didn’t work properly at all.