One-off
Designing resistor values for your BJT switch topology for an LED is pretty simple if you are only building one of these.
You can just assume \$V_{_{\large \text{LED}}}=2\:\text{V}\$, \$I_{_{\large \text{LED}}}=15\:\text{mA}\$, \$V_{_{\large \text{BE}}}=800\:\text{mV}\$, and \$V_{_{{\large\text{CE}}{\small SAT}}}=200\:\text{mV}\$ and move on with the rest of the design:
$$\begin{align*}
R_{_{\large \text{C}}} &= \frac{V_{_{\large \text{CC}}}-V_{_{\large \text{LED}}}-V_{_{{\large\text{CE}}{\small SAT}}}}{I_{_{\large \text{LED}}}}
\\\\
R_{_{\large \text{B}}} &= \left(\beta_{_{\large {SAT}}}=10\right)\cdot \frac{V_{_{\large \text{IN}}}-V_{_{{\large\text{BE}}}}}{I_{_{\large \text{LED}}}}
\end{align*}$$
And you can tinker around and get what you want without much thought. If the LED current isn't right, you can then just adjust \$R_{_{\large \text{C}}}\$ up or down to your liking.
Building several -- but only as isolated indicators
The question is a little more nuanced when you want to make several and want them all to operate more similarly to each other. Here, you need to spend a little more attention to details. It now becomes worthwhile to estimate the variations, if all you do is use a resistor in series with the LED.
Note:
- LEDs are notoriously different in the required voltage for any given operating current.
Let's look at a very common LED datasheet from Sparkfun:

It's a nice pick. Their recommended operating current is close to your own desire for \$15\:\text{mA}\$. Great! But notice that when running at \$20\:\text{mA}\$ they say the voltage drop can be anywhere from \$1.8\:\text{V}\$ to \$2.2\:\text{V}\$. And at \$15\:\text{mA}\$ these values will drop a little. They might drop by as much as \$100\:\text{mV}\$, worst case (old red LEDs had a bulk resistance of almost \$20\:\Omega\$!) So the range might be better estimated as \$1.7\:\text{V}\$ to \$2.1\:\text{V}\$.
You have three choices at this point:
- Don't waste any time and just design the circuit as if these are to be one-offs.
- Take the experience I offered to you about old-style red LEDs and go with a range of \$1.7\:\text{V}\$ to \$2.1\:\text{V}\$ and an average of \$1.9\:\text{V}\$ for design purposes.
- Get a bag of the LEDs you intend using, apply \$15\:\text{mA}\$ to 5 or 10 of them, and measure the voltage across them and place those values into a log book. (Always a good idea to keep a log book of everything you spend time doing!) Use the average voltage drop for your design purposes.
New Note:
- operating temperature and emitter current may significantly affect the operating \$V_{_{\large \text{BE}}}\$.
- variations from one BJT to another, even of the same part number, impact the operating \$V_{_{\large \text{BE}}}\$ (which may matter) and also active mode \$\beta\$ (which in this case mostly doesn't matter.)
- operating \$V_{_{{\large\text{CE}}{\small SAT}}}\$ will vary from BJT to BJT and over temperature.
The first item is probably the more important one. But to be honest? Even though there can be a lot of variation in BJTs, the variations usually don't matter that much in this circumstance. You could go to the trouble of getting some BJTs and measuring them, logging down those results. But it almost isn't worth the trouble.
So let's jump to the thinking about how well a simple design like this works with respect to having similar currents in various LEDs given the simple equations above in setting the values for the two resistors in your topology.
There's a concept called sensitivity. It's a way to quantify just how sensitive one thing is when some other thing changes or is different than what we planned on. In this case, the sensitivity equation (you can find the development for it here) is:
$$\begin{align*}
\%\, I_{_{\large \text{LED}}}&=\frac{\%\, V_{_{\large \text{CC}}}}{1-\frac{V_{_{\large \text{LED}}}}{V_{_{\large \text{CC}}}}}-\frac{\%\, V_{_{\large \text{LED}}}}{\frac{V_{_{\large \text{CC}}}}{V_{_{\large \text{LED}}}}-1}-\%\,R_{_{\large \text{C}}}
\end{align*}$$
This includes all three things that may vary. But we don't care about changes in the supply voltage (we can assume that's stable) and resistors are pretty precise, these days, so that also can be ignored. This leaves us with the middle term:
$$\begin{align*}
\%\, I_{_{\large \text{LED}}}&=-\frac{\%\, V_{_{\large \text{LED}}}}{\frac{V_{_{\large \text{CC}}}}{V_{_{\large \text{LED}}}}-1}
\end{align*}$$
You have \$V_{_{\large \text{CC}}}=9\:\text{V}\$ and for our purposes using that above datasheet and my own estimation about changing those values based upon using \$I_{_{\large \text{LED}}}=15\:\text{mA}\$: \$V_{_{\large \text{LED}}}=1.9\:\text{V}\$ and \$\%\, V_{_{\large \text{LED}}}\approx \pm\,10\%\$. So we find:
$$\begin{align*}
\%\, I_{_{\large \text{LED}}}&=\pm\,\frac{10\%}{\frac{9\:\text{V}}{1.9\:\text{V}}-1}\approx \pm\,2.7\%
\end{align*}$$
I think that means you don't have to worry much!!!
But the main point here is that there is a process to follow if you are making more than one of anything. You want to look up the variations and apply them in some kind of sensitivity analysis to make sure that variations in part behaviors don't lead to variations in the desired outcome that are excessive and unacceptable.
In this case? You are fine. But it's good to know how to check things out in different circumstances. The fact that you are using a \$9\:\text{V}\$ voltage source for a \$2\:\text{V}\$ LED is what makes this work so well. But if you were using \$3.3\:\text{V}\$, then you would need to take into account the BJT saturation collector-to-emitter voltage (as it is now more significant than before) and you'd find that there'd be a lot more variation in the design outcome. Perhaps still okay. Perhaps not. But you'd want to see the numbers just to be sure.
Note about using LEDs in displays
When LEDs are placed close to each other in displays, everything gets more difficult. This is because humans are REALLY GOOD at being able to see slight differences in color and slight differences in brightness when LEDs are placed right near each other.
In cases like this, everything starts to matter. Often, a designer for an LED sign will ask for binned LEDs. This means that the manufacturer has sorted them into bins based upon the common items of interest: such as brightness and color and voltage drop (at some operating current.) Buying binned LEDs allows a less complicated design approach. If binned LEDs are not available then the entire sign display design becomes more complicated.
LEDs can be a real pain, at times.