If you have "iCloud Photo Library" enabled in Settings > Photo & Camera, all photos will sync from iCloud to your iPhone.
See this page in the iPhone User Guide: http://help.apple.com/iphone/10/#/iph961b96c4d
By default, iCloud Photo Library will automatically enable "Optimize Storage" as well, meaning, that the iPhone will only download small, optimized versions for browsing. It will just look like all photos are stored on your iPhone, but actually the iPhone will download them from iCloud for browsing or editing. There will always just be as many photos on the iPhone as space permits. You will not get much storage back, if you disable iCloud Photo Library.
But do not delete any photos from your iPhone that you want to keep your computer or other devices. Deleting any photo from a device syncing with iCloud Photo Library will delete it from iCloud and your other synced devices as well.
If you prefer to disable iCloud Photo Library, just turn off iCloud Photo Library in Settings > iCloud > Photos, or Settings > Photos & Camera, see: Get help with your iCloud Photo Library - Apple Support
You can turn off iCloud Photo Library on a single device when you follow these steps:
- On your iPhone, iPad, or iPod touch, go to Settings > iCloud > Photos and turn off iCloud Photo Library.
- On your Mac, go to System Preferences > iCloud > Options next to Photos, then deselect iCloud Photo Library.
- On your Apple TV (4th generation), go to Settings > Accounts > iCloud and under Photos press Select to turn off iCloud Photo Library.
If you have Optimize Storage turned on, you might not have all of your original photos and videos on your device. To download the original photos and videos on your iOS device, go to Settings > iCloud > Photos and select Download and Keep Originals. On your Mac, open Photos, choose Photos > Preferences, then select Download Originals to this Mac. Then you can turn iCloud Photo Library off. You can also select the photos and videos that you want to download from iCloud.com.
Do not disable "Optimize Storage" if you do not have much free storage on your iPhone. Only after you disabled iCloud Photo Library on the iPhone delete the photos from your iPhone that you do not want on the device.