You can use the Count Tool to count objects in an image. To count objects manually, you click the image with the Count tool and Photoshop tracks the number of clicks. The count number is displayed on the item and in the Count Tool options bar. Count numbers are saved when you save a file.
Photoshop can also automatically count multiple selected areas in an image, and record the results in the Measurement Log panel. See Performing a measurement (Photoshop Extended).