Two major things to be aware of: 1) You can view photos synced via iCloud Photos by logging into iCloud.com but you cannot view the contents of an iCloud Backup and 2) If you delete photos from a device where iCloud Photos is turned on, they will also be deleted from iCloud and any other device where iCloud Photos is turned on; if you delete photos that were included in iCloud Backup, they won't be included in future backups and will eventually be lost.
More details:
If you have iCloud Photos turned on, the photos on the device are the same as on iCloud, with the possible exception that some of them may be space-saving optimized versions if you have that option turned on. You view them in the Photos app on an iOS device. You can also login to icloud.com and go to the Photos app there. See: Set up and use iCloud Photos - Apple Support
If you didn't have iCloud Photos turned on but do have an iCloud backup, you can restore the entire phone (not just the photos) from iCloud but you cannot otherwise view the contents of the backup. Restore or set up your device from an iCloud backup - Apple Support
Also:
iCloud Photos is a syncing service. Any photo you delete from a device where iCloud Photos is turned on will also be deleted from iCloud and from any other device connected to iCloud Photos. You can potentially reduce the storage space required on a device by turning on Optimize Storage. See: Set up and use iCloud Photos - Apple Support
Apple does not currently offer cloud-only storage for photos. If that is what you want or need, you may want to explore 3rd party options such as Google Photos or Dropbox.
Another way that photos may be on iCloud (if you don’t have iCloud Photos turned on) is via a backup of an iOS device. The only thing you can do with a backup is use it to restore a device or set up a new device. The contents of backups are not viewable at iCloud.com and if you delete a photo from a device it will not be included in future backups and will be lost.