NPN transistor not switching 12V from microcontroller
The circuit you should should definitely shut off the LED current when V1 is switched from 5 V to 0 V.

Most likely the problem is that the transistor is connected incorrectly.  Look carefully at the datasheet to see which leads are emitter, base, and collector, then make sure your circuit is really connected that way.

It's hard to tell from your picture how exactly the transistor is hooked up.

Also note that while many transistors have leads E-B-C from left to right when looking at the flat, that is certainly not universally true.  You have to read the datasheet for your specific transistor, then double-check that it is connected correctly.