Hello denisse56,
It sounds like the iPhone storage is full, while there is still plenty of room available on iCloud.
You can check how much iCloud storage you have available, and how much is being used by tapping on Settings > [your name] > iCloud.
Just for information purposes, here is an explanation of the difference between storage on the iPhone and storage on iCloud: What's the difference between device storage and iCloud storage? - Apple Support
There are a couple of ways to free up storage on the iPhone by using iCloud. iCloud Photos can help free up a storage. When iCloud Photos is activated, the original high-resolution version of the photos and videos that are on the device are uploaded to iCloud, leaving a much smaller, lower resolution version on the device. The original can be re-downloaded whenever needed.
These steps from Set up and use iCloud Photos - Apple Support explain how to turn iCloud Photo on:
Turn on iCloud Photos
Make sure that you set up iCloud and sign in to iCloud with the same Apple ID on all of your devices. If you have a PC, you need Windows 7 or later and iCloud for Windows.
On your iPhone, iPad, or iPod touch
1. Go to Settings > [your name].
2. Tap iCloud.
3. Tap Photos, then turn on iCloud Photos.
You can also choose the other iCloud service to use from this same location.
Have a good day.