I am sorry to hear about your loss. My condolences.
To save your wife's photos: The method suggested by Alma1090 will work, but you will save just the photos, not the photo libraries with the albums, the adjustments, etc.
As you have a Mac and are using Photos on a Mac, I would merge the two libraries on your Mac. It will be easier, as Photos on a Mac is more powerful than the iPhone version.
Can you access your wife's user account the iMac?
- Open Photos in her user account.
- Make sure, that your wife's Photos Library on the iMac is in sync with her iCloud Photos Library, but all photos have been downloaded from iCloud. Disable "Optimise Storage" for her Photos Library (Photos > Preferences > iCloud) and wait for her photos to download from iCloud.
- Add a keyword "Her Photos" to all photos in Photos. Select all photos at once with ⌘A, open the Info with ⌘I and type a keyword "Her Photos" into the Info. Now you can find her Photos in a search or use the "Showing only" filter to see either your photos or her photos. You my want to tag your own photos with keyword "My Photos" in your user account as well.
Then I would copy her Photos Library from the Pictures folder to an external volume with plenty of space. Prepare this volume as described here: Move your Photos library to save space on your Mac - Apple Support
It is important to set the "Ignore Ownership on this volume" flag, or you may encounter permissions problems, when you try to open her library from your user account.
Now you can merge her Photos Library with your Library in a lossless way, simply by opening the copy of her user library from your user account.
- Sign into your user account. Launch Photos while holding down the options key ⌥ and select her Photos Library on the external volume.
- Make this library the system photos library (Photos > Preferences > General: Use as system photos Library).
- Make this library your iCloud Photos Library (Photos > Preferences > iCloud: iCloud Photos)
Now the photos from your Wife's library will be merged into your iCloud Photos, photos and albums, all metadata tags, like titles, keywords, places, named, faces, etc. This may take several days, if the library is large.
Once the library has been uploaded into your iCloud Photos Library, you can switch back to your own Photos Library on your system volume, if you have enough storage there.
I would make a backup copy of your own Photos Library and your wife's library, before you start merging the libraries.