I tried to get a estimate for an upper-bound with currently deployed instruments. Assuming that, resolution-wise, the James Webb Space Telescope is the best telescope we have today, I looked into its FAQ at https://jwst.nasa.gov/content/about/faqs/faq.html#sharp to find its angular resolution:
What is Webb's angular resolution, and how will its images compare to Hubble's? Will they be as beautiful?
Webb's angular resolution, or sharpness of vision, will be the same as
Hubble's, but in the near infrared. This means that Webb images will
appear just as sharp as Hubble's do.
Webb will have an angular resolution of somewhat better than 0.1
arc-seconds at a wavelength of 2 micrometers (one degree = 60
arc-minutes = 3600 arc-seconds). Seeing at a resolution of 0.1
arc-second means that Webb could see details the size of a US penny at
a distance of about 24 miles (40 km), or a regulation soccer ball at a
distance of 340 miles (550 km).
Now imagine we can distribute stars at will around the celestial sphere. The best distribution I can imagine, to fit the maximum number of stars while still keeping angular resolution, is to put them evenly spaced at the celestial equator, at 0.1 arc-second intervals. And then do the same for every parallel circle above and bellow, separated by 0.1 arc-seconds of celestial "latitude" (as the parallel circles shrink by cos(latitude angle), its necessary to adjust the number of stars accordingly). The following Pharo 10 code calculates approximately how many stars we could fit this way:
| resolution starsAtEquator starsInHemisphere |
resolution := 0.1. "Resolution in arc-seconds"
starsAtEquator := 360 * 60 * 60 / resolution.
starsInHemisphere := ((0 to: starsAtEquator // 4) collect: [ :each |
(each * Float pi / (starsAtEquator // 2)) cos
* starsAtEquator round: 0 ]) sum.
show: 'Stars in whole celestial sphere: ';
show: 2 * starsInHemisphere
The result is about 5.35e13, or about 50 trillion objects individually resolvable, at James Webb resolution.
Correction: In the first version of this answer, I said that If it took only one second to reposition the telescope to look at a different point, it would take more than one and a half million years to cover the entire sky, assuming it would have to reposition at every point. But as pointed by @planetmaker, the field of view of the James Webb telescope is 3' x 3', so the time to cover the entire sky would be much lower.