When you set up your device to use Photos with iCloud, you can turn on the iCloud Photos feature (previously called iCloud Photo Library).
With iCloud Photos, all the photos and videos from your device are stored in iCloud. You can access them from any device where you are signed in with the same Apple ID and the iCloud Photos feature is turned on. When you edit, organise or delete a photo or video on one device, those changes appear on all your devices.
Photos and videos stored in iCloud Photos count towards your iCloud storage.
For more information about iCloud Photos and how it differs from My Photo Stream, see the Apple Support article About iCloud Photos and My Photo Stream.