It depends which iCloud setting is on. Your photos are encrypted in iCloud either way, but "encrypted" does not mean Apple cannot read them. What matters is who holds the key.
With the default, standard data protection, Apple holds the key to iCloud Photos. Apple can read your photos, and can provide them when legally required. With Advanced Data Protection turned on, the key stays on your trusted devices and Apple does not have it.
Standard data protection is the default
If you never changed this setting, your account uses standard data protection. Apple lists Photos as encrypted in transit and on its servers, with the keys stored by Apple.
That keeps your photos scrambled on the network and on Apple's disks. Someone who pulls a drive out of a data center gets noise. Apple itself can still decrypt them, because it has the key. That is how Apple can restore your library after you lose every device and forget your password, and it is why Apple can hand over iCloud Photos in response to a valid legal request.
Health, Passwords and Keychain, and Messages in iCloud are already end-to-end encrypted in this mode. Photos stay with Apple's keys until you turn Advanced Data Protection on.
Advanced Data Protection takes the key away from Apple
Advanced Data Protection is optional. It has been available since iOS 16.2, iPadOS 16.2, and macOS 13.1, and every device on your Apple Account has to be running a version that supports it before you can turn it on.
With it on, Photos moves to end-to-end encryption. The key is stored on your trusted devices. Apple still keeps the encrypted files, but it has no key to open them.
The same switch moves more than photos. iCloud Backup (including the device backup and the Messages backup), iCloud Drive, and Notes move too, along with other categories.
To turn it on, go to Settings > [your name] > iCloud > Advanced Data Protection > Turn On Advanced Data Protection. The screens are in how to turn on Advanced Data Protection.
What Apple can still read with it on
iCloud Mail, Contacts, and Calendars do not change. Even with Advanced Data Protection on, they stay encrypted in transit and on the server, with the keys at Apple. Mail has to work with the rest of the world's email, and Contacts and Calendars sync over the CardDAV and CalDAV standards, so Apple leaves them out.
A photo you send by email is Mail. The key for it stays with Apple either way.
What you give up
Apple cannot recover what it cannot read. Before you can turn the switch on, the account needs a way back in. Under Account Recovery, tap Set Up Account Recovery and add a Recovery Contact, a Recovery Key, or both. If you lose those and your trusted devices are gone, Apple cannot recover your end-to-end encrypted data.
Turning it on also turns off web access to your data on iCloud.com. You can turn web access back on, and a trusted device then approves a temporary session in the browser. That session does not mean Apple holds your photo key.
If you turn Advanced Data Protection off later, your devices upload the keys back to Apple, and your data returns to standard data protection.
The copy on your phone is a separate question
All of this is about the copy in iCloud. The copy on the iPhone has its own protection, covered in how the iPhone encrypts photos on the device.
A photo can also stay off iCloud and live only on the phone, which is the choice Privately is built for.