For 20mA the power dissipated in the 1k resistor is I²R or 0.02² x 1000 = 400mW. The worst-case dissipation if the transistor were fully on into a short circuit would be V²/R or 24²/1000 = 576mW. For either case a 1W resistor will be fine.
Edit: If you are thinking about designing any other circuits, you should consider simulating with a free Spice program such as LTSpice. A simulator allows you to verify that the circuit is likely to work before you build the breadboard. It often saves a lot of redesign and reworking of the breadboard circuit.
Yeah good idea to simulate a circuit before making it
I pluged 4 resistors of 4K 0.25W in parallel and they are heating I don't understand!
It should do the same thing as a 1K 1W resistor no?
I mesured that 8.5mA is going through the 4 resistors, so 8.5/4 is the current in each resistor. It should not heat normally! It's something wrong with the transistor...