Can I configure my Mac to store documents and pictures on iCloud only
You can buy additional storage, but this will not help you in your case. Documents in iCloud are always synced with your Mac, so anything you remove on your Mac will also be removed from iCloud. 

You need to look into other cloud storage solutions (eg Dropbox with selective syncing) if you want to temporarily want to offload something into the cloud. Or buy an external drive (which may be simpler).