Can you explain a bit more, what you are trying to do? Do you want to use iCloud Photos to sync your photos to a computer? Or do you want to use iCloud as an additional storage for your photos? With only the free 5GB of iCloud storage, you can only use iCloud for photos, if you are having just a few photos on your iPhone.
When you are using iCloud Photos, the iPhone and iCloud will be in sync. Your complete Photos Library from your iPhone will be uploaded to iCloud and then sync back to the iPhone. You need enough storage in iCloud to hold all your photos, all your iCloud emails, Contacts and iCloud backups, whatever you are using iCloud for.
This requires that you usually need more iCloud storage than the storage on your device. 5GB of cloud storage will only suffice for iCloud Photos, if you only have very few photos and videos on your iPhone, no more than 1GB or so, or the photos will quickly fill iCloud and make it impossible to use the other iCloud services. With a 64GB iPhone you should get yourself a 200GB iCloud storage plan, if you plan to use iCloud for your media files like photos and videos, at least more than the internal storage of your iPhone has, or you will not even be able to make backups of your iPhone.