iCloud isn't actually a true backup service. It is a syncing service. When you delete a photo from iCloud, the photo will delete everywhere simultaneously. This link will better explain how iCloud Photo works.
If you are out of space and if photos are taking up the most space, connect your iPhone to your computer (Windows or Mac) and upload the photos to your computer. Then you can remove the photos from iCloud to free up space, but the photos will no longer be accessible on your iPhone unless you choose them to put back via a sync from your computer to your iPhone.
This link explains how to upload photos to your computer, from your iPhone --> Transfer photos and videos from your iPhone or iPad to your Mac or PC - Apple Support