You'll need to sign out of your current iCloud account first. Upon doing so, you'll be asked if you want to keep your photos, or remove them from the phone.
If you keep them on the phone, you'll need to have enough storage space on the device to download all the originals (if you were using optimized storage). Signing into another iCloud account will then sync the photos to that account.