Once you run out of space, the photos already on iCloud will still be there, but the syncing service will stop, so you won't find the new images until you get more space. If you delete a photo, it will remain in iCloud for 30 days. After that, it gets permanently deleted. Lastly, iCloud backups stay available for 180 days after you stop using them. Then, they're deleted.