You can add as much memory in iCloud as you want, but it won't do anything to add space to your iPhone. I'm going to guess the photo didn't save because you are out of space on your phone itself? Open Settings > General > iPhone Storage and see how much space you have out of how much total space. If, as I suspect you are out of memory on your iPhone, you need to delete things you don't need or use. That can include; Photos, Apps, Music, Files, Email, Messages, etc. Once purchased, all the space you have on the phone was the amount of space it came with out of the box.
Read this about the difference between Device and iCloud Storage --> What's the difference between device storage and iCloud storage? - Apple Support
The bottom line is if the photo didn't have anywhere to go on your iPhone, it doesn't exist.