Because you declared the led variable inside of the setup function it is only in scope within that function. This is why you get the error that it was not declared in this scope when you try to use it in the loop function. In order to use the variable in both functions you need to declare it in the global scope like this:
int led = 13;
void setup() {
pinMode(led,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(led,HIGH);
delay(1000);
digitalWrite(led,LOW);
delay(1000);
}
If you compare your code to File > Examples > 01.Basics > Blink you will see that's exactly what it does.