How many photos/videos ?

Users want to know how many photos/videos they have in Google Photos for various reasons, for example to check for completeness. Note however that, when you upload, exact duplicates may be skipped, even when they have different titles, thus comparing exact numbers may be difficult. 

Selecting items

The probably most exact way is to select all photos in the Photos and Archive tabs of https://photos.google.com/.
That is a challenge when you have many, but I managed to count about 40.000 in less than 10 minutes. 
See Select multiple pictures

Using Gmail or Google Drive app on an Android device

First you must select the correct account in the Google Photos app (if you have more than one). This method should work when Backup and sync is set to upload to that account. When Backup and sync is turned OFF for that account, it will also count photos that are on the device and shown in the Photos app but not uploaded.

This method does NOT count archived photos. 

In the Gmail app

It shows on top the number of items shown in the Photos app for the active account. 

In the Google Drive app

Similarly you can:

This gives the exact same result as the Gmail method, with the same limitation.

The dashboard

The dashboard https://myaccount.google.com/dashboard used to give numbers which could be completely wrong, for example because photos in albums were counted twice. This has now been replaced by a vague indication, like 5000+ photos. The number of albums still does not seem reliable. 

Albums

Albums can take up to 20.000 photos. Adding photos to albums may be a way to count, since each album shows the number of photos in the album. To avoid double or more counting, albums for a given period (one or more years) should be considered. 

Google Takeout

The use of albums makes me think of using Google Takeout, where year albums ("Photos of yyyy") are available for downloading.  I doubt that exact numbers are given, and effectively downloading is needed, which is a good idea when you have your photos only in Google Photos and on a phone. See Google Photos is NOT a "Backup" of Your Photos