As Ingo2711 says, iCloud Photos doesn't behave like an external drive-- it's not a place you can put pictures for extra space or as a backup. iCloud is a synchronization service. When you engage iCloud Photos, for instance, then the Library on your iPhone is kept exactly the same as the iCloud Photos Library. So, for instance, if you take a picture with your iPhone, it is added to the iPhone's Photos Library, copied to iCloud Photos Library at iCloud.com, and then copied to the Photos Library on each of the other devices that you have connected. If you delete a picture on your phone, then that picture is deleted at iCloud and on all the other devices. So you can't think of iCloud Photos as a full backup service, since it backs up mistakes just as quickly as it copies pictures.
With iCloud, you can use Optimize Storage on your iPhone or other Apple devices. Many kinds of storage can be optimized, but Optimizing Photos storage is especially useful. At System Settings>[name]>iCloud>Photos:

If you set Photos to "Optimize Storage,"on your iPhone, then Photos may store only smaller images on the phone and rely on iCloud to keep the full sized images. This is great, since with the lower resolution images you can scan through pictures very quickly, and they look great on the iPhone screen. So, if Optimize is chosen, and you want to edit a picture, Photos will reach out to iCloud to get a full sized image for you to work on. Your optimized Library may take up less than 15% of the space of a fully downloaded Library, but you can still see all the pictures on your phone! But an optimized Library may be kept larger than that if the extra storage space is not needed. All this happens automatically and transparently, so you may not even notice that you have Optimize turned on.
Again, as Ingo2711, said, you still need to back up your pictures to an external drive or to a computer.