This was a project I was working on last spring. I basically concluded that it can't be done and here's the proof why. But maybe someone can prove me wrong and try to figure it out.
I would count the stars shown on most view screens where the star is considered charted like here in the astrometrics lab.
but if the screen is a simulation of some kind where we don't know if the stars actually exist or were just made up in the simulation, a discussion could be made about whether those should count as stars or not. Like in Enterprise episode "strategem"
In scenes where stars are shown outside of the window it's possible that they will reuse the same stars for different scenes.
First I tried counting them by hand which was pretty tedious... This is from the first moments of episode "The Cage"
Then I wrote an application that would try to count the stars for me.
I ran into the problem of trying to define what should be considered a star. How small is too small and how dark is too dark.
These were the numbers I was getting. Where RGB(255, 255, 255) requires that a star have some perfectly white pixels and RGB(0,0,0) is completely black
RGB(40, 40, 40) = 504 stars
RGB(30, 30, 30) = 595 stars
RGB(20, 20, 20) = 710 stars
RGB(12, 12, 12) = 812 stars
RGB(10, 10, 10) = 850 stars
RGB(5, 5, 5) = 940 stars
RGB(3, 3, 3) = 1003 stars
RGB(1, 1, 1) = 1970 stars
I had this one show the individual star counts
People's vision varies, what might be visible to some people would not be visible to others. This application was able to detect stars not visible to the human eye as well. If I tried to draw a line about what's considered a "clearly visible star" or "somewhat visible star" I still ran into the same problem. No matter where I draw the line, there's a star just under that line and just above that line that visibly look the same.
Here's an example of the list of stars ordered from brightest and largest to smallest and darkest
It's like asking how many bald men are there are on earth. The problem cannot be solved without a precise definition of "hair", "man", and "bald" but these words by their nature are not precisely defined.
I think this problem is formally defined as the problem of counting something with an indeterminate identity http://rgheck.frege.org/pdf/unpublished/IndeterminateIdentity.pdf
I would count the stars shown on most view screens where the star is considered charted like here in the astrometrics lab.

but if the screen is a simulation of some kind where we don't know if the stars actually exist or were just made up in the simulation, a discussion could be made about whether those should count as stars or not. Like in Enterprise episode "strategem"

In scenes where stars are shown outside of the window it's possible that they will reuse the same stars for different scenes.

First I tried counting them by hand which was pretty tedious... This is from the first moments of episode "The Cage"

Then I wrote an application that would try to count the stars for me.

I ran into the problem of trying to define what should be considered a star. How small is too small and how dark is too dark.

These were the numbers I was getting. Where RGB(255, 255, 255) requires that a star have some perfectly white pixels and RGB(0,0,0) is completely black
RGB(40, 40, 40) = 504 stars
RGB(30, 30, 30) = 595 stars
RGB(20, 20, 20) = 710 stars
RGB(12, 12, 12) = 812 stars
RGB(10, 10, 10) = 850 stars
RGB(5, 5, 5) = 940 stars
RGB(3, 3, 3) = 1003 stars
RGB(1, 1, 1) = 1970 stars





I had this one show the individual star counts

People's vision varies, what might be visible to some people would not be visible to others. This application was able to detect stars not visible to the human eye as well. If I tried to draw a line about what's considered a "clearly visible star" or "somewhat visible star" I still ran into the same problem. No matter where I draw the line, there's a star just under that line and just above that line that visibly look the same.
Here's an example of the list of stars ordered from brightest and largest to smallest and darkest
Star:680 Size:705 Width:41 Height:41 Brightness:71.6
Star:4 Size:237 Width:14 Height:22 Brightness:69.4
Star:598 Size:205 Width:14 Height:19 Brightness:93.5
Star:652 Size:124 Width:14 Height:12 Brightness:58.1
Star:107 Size:118 Width:13 Height:13 Brightness:51.5
Star:2 Size:110 Width:12 Height:12 Brightness:47.1
Star:193 Size:106 Width:12 Height:12 Brightness:57.5
Star:26 Size:102 Width:11 Height:13 Brightness:53.7
Star:569 Size:100 Width:9 Height:15 Brightness:59.9
Star:705 Size:97 Width:11 Height:11 Brightness:47.5
Star:42 Size:97 Width:11 Height:11 Brightness:41.9
Star:283 Size:97 Width:11 Height:12 Brightness:35.7
Star:44 Size:96 Width:9 Height:15 Brightness:59.6
Star:38 Size:94 Width:11 Height:11 Brightness:60.8
Star:122 Size:86 Width:9 Height:13 Brightness:39.3
Star:645 Size:85 Width:11 Height:9 Brightness:60.4
Star:479 Size:83 Width:8 Height:13 Brightness:55.2
Star:53 Size:79 Width:9 Height:12 Brightness:84.1
Star:539 Size:75 Width:8 Height:13 Brightness:100.4
Star:596 Size:73 Width:10 Height:10 Brightness:69.8
Star:52 Size:73 Width:9 Height:10 Brightness:63.9
Star:576 Size:73 Width:9 Height:12 Brightness:61.4
Star:91 Size:71 Width:8 Height:12 Brightness:88.8
Star:64 Size:68 Width:9 Height:10 Brightness:57.8
(skipping hundreds of stars to stay without posting size limit)
Star:245 Size:1 Width:1 Height:1 Brightness:15.3
Star:549 Size:1 Width:1 Height:1 Brightness:15.3
Star:250 Size:1 Width:1 Height:1 Brightness:15
Star:255 Size:1 Width:1 Height:1 Brightness:15
Star:293 Size:1 Width:1 Height:1 Brightness:15
Star:691 Size:1 Width:1 Height:1 Brightness:15
Star:707 Size:1 Width:1 Height:1 Brightness:15
Star:146 Size:1 Width:1 Height:1 Brightness:14.7
Star:257 Size:1 Width:1 Height:1 Brightness:14.7
Star:380 Size:1 Width:1 Height:1 Brightness:14.3
Star:168 Size:1 Width:1 Height:1 Brightness:14
Star:294 Size:1 Width:1 Height:1 Brightness:14
Star:683 Size:1 Width:1 Height:1 Brightness:13.7
Star:684 Size:1 Width:1 Height:1 Brightness:13.7
Star:131 Size:1 Width:1 Height:1 Brightness:13.3
Star:349 Size:1 Width:1 Height:1 Brightness:13.3
Star:165 Size:1 Width:1 Height:1 Brightness:13
Star:235 Size:1 Width:1 Height:1 Brightness:13
Star:238 Size:1 Width:1 Height:1 Brightness:13
Star:627 Size:1 Width:1 Height:1 Brightness:13
Star:158 Size:1 Width:1 Height:1 Brightness:12.7
Star:675 Size:1 Width:1 Height:1 Brightness:12.7
Star:124 Size:1 Width:1 Height:1 Brightness:12.3
Star:139 Size:1 Width:1 Height:1 Brightness:12.3
Star:145 Size:1 Width:1 Height:1 Brightness:12.3
Star:761 Size:1 Width:1 Height:1 Brightness:12.3
Star:32 Size:1 Width:1 Height:1 Brightness:12
Star:269 Size:1 Width:1 Height:1 Brightness:12
Star:40 Size:1 Width:1 Height:1 Brightness:11.7
Star:130 Size:1 Width:1 Height:1 Brightness:11.7
Star:276 Size:1 Width:1 Height:1 Brightness:11.7
Star:542 Size:1 Width:1 Height:1 Brightness:11.7
Star:436 Size:1 Width:1 Height:1 Brightness:11.3
Star:746 Size:1 Width:1 Height:1 Brightness:10.7
It's like asking how many bald men are there are on earth. The problem cannot be solved without a precise definition of "hair", "man", and "bald" but these words by their nature are not precisely defined.
I think this problem is formally defined as the problem of counting something with an indeterminate identity http://rgheck.frege.org/pdf/unpublished/IndeterminateIdentity.pdf