It prints values, but the LED light does not go off.
. This implies that you have some code that is supposed to turn the LED on or off. It also implies that that code is not working correctly. Further, it implies that you would like help understanding why it does not.
And yet you want us to guess what code you have, and why it does not work. No can do.
You are printing the distance. This means that you know some values. Under what circumstances do you want the LED to come on? Under what circumstances do you want the LED to go off.
If you want to turn an LED on, use digitalWrite(), specify a pin number as the 1st argument, and use HIGH as the 2nd argument. If you want it to go off, specify LOW as the 2nd argument. Blinking LEDs is usually the 1st thing that people learn how to do, so it is a not unreasonable assumption that you know how to do this.
You can use an if statement to conditionally turn the LED on or off:
if(distance > 4 && distance < 39)
// Turn the LED on
// Turn the LED off
Spending a few minutes reading stuff on this site http://arduino.cc/en/Reference/HomePage will prove useful.
This is a small portion of a large project.
Then you definitely need to learn the basics before you try anything larger.