See the number of open windows for an app in the macOS Dock

Solution 1:

This is not exactly what you are asking for. But better, in my opinion.

I use HyperDock https://bahoom.com/hyperdock/ which shows thumbnails of all windows. It has other features too, which I leave you to explore. And my preference is the version from the HyperDock web site, not from the App Store.

Two Safari Windows