See if you can recover the ID/password.
Apple ID - How to find your Apple https://support.apple.com/en-us/HT201354 An iCloud e-mail address is an Apple ID.
Apple ID - Find https://iforgot.apple.com/appleid#!§ion=appleid
Enter the Apple (iCloud) ID and click Forgot Password.
Apple ID - Manage https://appleid.apple.com/#!&page=signin
Apple ID – Forgot Password https://support.apple.com/en-us/HT201487
If necessary, if you are the original owner, take the device, the original purchase receipt with the serial number, and a photo ID to the nearest Apple Store.
Genius Bar Reservation and Apple Support Options - Apple. https://www.apple.com/retail/geniusbar/
or contact Apple ID Support. They will need to see the original purchase receipt/paperwork also.
Apple ID - Official Apple Support. https://support.apple.com/apple-id
Contact Apple for help with Apple ID account security - Apple Support. https://support.apple.com/en-us/HT204169
Get Support https://getsupport.apple.com/. Work through the screens to get a chat option.
https://twitter.com/AppleSupport
Or fill out and submit iTunes Store - Contact Us - Official Apple Support https://support.apple.com/en-euro/itunes-contact The form is for iTunes, but it will get passed to the ID Support section.
After the phone is unlocked, do the below before giving it to your grandmother.
Selling/Giving Away Device. https://support.apple.com/en-us/HT201351