That message is displayed when you try to turn on iCloud Photos on your phone and you have photos on the phone that were synced to the phone from a computer.
If those photos are still on the computer you could normally agree to them being deleted from the phone. Note if that computer is synced with iCloud, the photos deleted from the phone will eventually be synced back to the phone from iCloud. If that computer is not synced with iCloud, you could AirDrop the photos to the iPhone after the iCloud Photos sync of the phone has completed (or if a PC, upload those photos to iCloud).
This is described in the following excerpts from Get help with iCloud Photos - Apple Support
Any photos or videos that you copy to your device through iTunes or the Finder are not copied in iCloud Photos.Â
Upload originals from your iPhone, iPad, or iPod touch to your Mac
To upload original, full resolution versions of your photo library to your Mac, turn on iCloud Photos on your Mac.Â
Copy photos from your Mac to your iPhone, iPad, or iPod touch
- Make sure that you're signed in with the same Apple ID on your computer and your device.
- Unlock your iOS device and turn on AirDrop.
- Open a new Finder window on your Mac and choose AirDrop in the sidebar.
- Drag the photos to the icon for the iOS or iPadOS device in the Finder window.
Upload photos from your PC
Learn how to upload photos and videos to iCloud Photos