iCloud & iCloud Photos · Messages, Mail and device backups in iCloud
What happens if I turn off Messages in iCloud on my Mac?
Short answer: The Mac stops syncing conversations via iCloud: existing messages stay on it and new ones still arrive, but deletions and read status no longer sync. Turning it off on all devices moves message history out of iCloud storage into each device.
Your Mac stops syncing conversations through iCloud. The messages already on the Mac stay there, and new messages still arrive while you're signed in to iMessage — but deletions and read status no longer sync, so the Mac and your other devices can drift apart.
macOS may also offer to turn it off on all your devices, which moves message history out of iCloud storage and into each device (and its backup). Choose carefully: that's a larger change than switching off one Mac. The setting is in Messages → Settings → iMessage.