I'm terribly sorry to hear that.. here is some misc reading you can do to be prepared for next time
Set up and use iCloud Photos - Apple Support
iCloud Deconstructed - Apple Community
If all you have for Apple devices is your iPhone, you may not even want/need to use iCloud photos. It's better for syncing than anything else. (ie you also have an iPad and a MacBook and you want the pictures readily available on all devices). Also can be used to free up space on your iPhone.
So if you would prefer to keep your photos on your iPhone and make it so that your backups do include the photos, you'd want to turn off the switch in Settings > [your name] > iCloud > Photos.
If you take a bunch of photos and you don't have a large capacity phone, you will eventually run out of space, but there are options. You can look into Google Photos, which I hear actually keeps the photos and lets you delete them from your device. Amazon photos might do the same thing. I'm sure there are other options as well.
You could also transfer photos to a computer and delete from your phone to save space
Transfer photos and videos from your iPhone, iPad, or iPod touch - Apple Support
If you do continue to use iCloud photos, and you come into the same situation.. Next time turn off iCloud photos on the old phone before deleting the pictures. This should have prevented what happened to you.
Also, just in case this info is helpful to you.. if you are planning to leave your iPhone as is and let your son use it, you should really be creating him an Apple ID and wiping the phone, setting up family sharing.. possible parental controls. Apple IDs were not meant to be shared. A few support articles to review below
Help your child set up an iPhone, iPad, or iPod touch - Apple Support
How to create a new Apple ID - Apple Support
Set up Family Sharing - Apple Support
Use parental controls on your child's iPhone, iPad, and iPod touch - Apple Support