If we use BJT as a switch then we add R2 to create path to GND to avoid base from floating.
And sometimes the low level voltage is to high to ensure cut-off.
So we put R2 to proper cut-off the bjt.
R1 depends on the transistor, the collector load and the voltage source driving the base. As a rule of thumb for a low saturation voltage the base current should be 1/10th of the collector current.
Assuming the emitter goes to 0V and it's not driven an op-amp with a high, low side saturation voltage, the value of R2 is not important and is just there to speed up the switch off, improve noise immunity and minimise the leakage current.