If you only turn on Apple menu > System Preferences > Apple ID > iCloud > iCloud Drive then only files/folders that you save to the iCloud Drive folder on your Mac will sync with iCloud. You access the iCloud Drive folder via the Finder sidebar or the Finder "Go" menu.
If you also turn on the Desktop and Documents option, then files/folders in those locations will also sync with iCloud.
Finally, if you turn on Apple menu > System Preferences > Apple ID > iCloud > Optimize Mac Storage then if your Mac is low on storage space some of the synced files may not have a local copy on your Mac.
See the following:
Set up iCloud Drive - Apple Support
Access and manage your files in iCloud Drive - Apple Support
Add your Desktop and Documents files to iCloud Drive - Apple Support