Okay, stop right in your tracks! Before you do anything more with millis(), change any time variables you use (like firstPress) to the unsigned long type. If you don't, you will have rollover issues when millis() resets to 0.
The data collection and action on the data should be in separate parts:
int ledverde = 3;
int ledambar = 4;
int ledrojo = 5;
int pulsador1 = 6;
int pulsador2 = 7;
int pulsador3 = 8;
unsigned long firstPress;
unsigned long secondPress;
void setup() {
 pinMode (ledverde, OUTPUT);
 pinMode (ledambar, OUTPUT);
 pinMode (ledrojo, OUTPUT);
 pinMode (pulsador1, INPUT);
 pinMode (pulsador2, INPUT);
 pinMode (pulsador3, INPUT);
 Serial.begin(9600);
}
void loop() {
 // first get the button press:
 while (((digitalRead(pulsador1)) == (LOW))); //wait for press
 firstPress = millis ();
 delay (20); // debounce the switch
 while (((digitalRead(pulsador1)) == (HIGH))); //wait for release
 secondPress = millis ();
 // secondly, blink the LED:
 if ((secondPress - firstPress) > 1400) {
  digitalWrite (ledrojo, HIGH);
  delay (35);
  digitalWrite (ledrojo, LOW);
 }
 else if ((secondPress - firstPress) > 700) {
  digitalWrite (ledambar, HIGH);
  delay (35);
  digitalWrite (ledambar, LOW);
 }
 else {
  digitalWrite (ledverde, HIGH);
  delay (35);
  digitalWrite (ledverde, LOW);
 }
}
Testing for <=1400 is redundant in the second else if because you already screened it out in the first if.
Let us know how it runs. I don't have hardware to test it with today.
// first get the button press:
while (((digitalRead(pulsador1)) == (LOW))); //wait for press
firstPress = millis ();
delay (20); // debounce the switch
while (((digitalRead(pulsador1)) == (HIGH))); //wait for release
secondPress = millis ();
Testing for <=1400 is redundant in the second else if because you already screened it out in the first if.
Let us know how it runs. I don't have hardware to test it with today.
Okay, now I see where I was having the trouble. Anyway, thank you very much, kind user of this forum, you helped me a lot