Some of what you say is rather confusing. There's a difference between turning off syncing of Desktop & Documents, and turning off iCloud Drive. You say "turn off iCloud backup," and that's a different thing altogether.
As muguy said, if you turn off syncing Desktop & Documents, then the folders remain in your iCloud Drive with all the contents, and new empty D&D folders are created in your user folder, back to normal. If you want, you can copy the stuff from the non-synced folders in iCloud Drive to the new folders.
If you turn off iCloud syncing altogether, then all your stuff is saved at iCloud.com, and you could download your files from there to your computer. Downloading over the internet seems awkward to me, so personally, I would copy everything to my computer before turning off iCloud. Like between any folders on a Mac, if you drag stuff from the iCloud Drive folder to your user folder, then it will be moved rather than making an extra copy.
You might look at this:
Understanding iCloud Drive - Apple Community