First of all, iCloud storage isn't just photos. It's all the data on your iPhone and over the years, you accumulate a lot of data, which adds to the free 5GB of storage you get from Apple. Then there's the physical storage on your phone itself, which is unrelated to the space you have in the cloud.
Open Settings > General > iPhone Storage - how much is available out of the total space on your phone?
Do note that once you've used up the space you had in the cloud, you won't be able to continue to backup your iPhone to the cloud, which means if something goes wrong with your phone and you need to restore from a backup, you will lose data, which may be meaningful to you. For about $1 a month, you can go to the next storage plan for iCloud, which will increase your iCloud space to 50GB. See how here --> Buy iCloud+ or upgrade your current storage plan - Apple Support