If you are using iCloud Photo Library, then see the "How do I delete photos and videos from a device using iCloud Photo Library?" section in:
Get help with your iCloud Photo Library - Apple Support
Be aware that iCloud is a syncing service, not simply offline storage. If you delete the photos in iCloud, then they will also be deleted on all your devices signed into iCloud. You may want to archive them to your computer first:
Transfer photos and videos from your iPhone, iPad, or iPod touch - Apple Support