It is executing this every loop iteration:
if(wiper>=2 && wiper<3){
digitalWrite(led1,HIGH);
}
So unless you move the pot back out of that resistance range the LED will not cut off. Actually it will turn it off for a very short time once a second but you probably won't notice. Also, you should set oldTime=millis() when you are in the resistance range and maybe set a flag so you won't test the range any more.