Please help a beginner here. expected constructor...

Hello everyone!
I get "expected constructor, destructor, or type conversion before '(' token" in the last line.

int Relay = 2;
int stateRelay = LOW;
long time = 0;
int stayON = 1200000; //stay on for 5000 ms

void setup() {
  pinMode(Relay, OUTPUT);
}
  
 digitalWrite(Relay, HIGH);
 delay(stayON);
 digitalWrite(Relay, LOW);

I don't know what's the cause of this Error...

You need to move the closing } of setup() below those other lines like this:

int Relay = 2;
int stateRelay = LOW;
long time = 0;
int stayON = 1200000; //stay on for 5000 ms

void setup() {
  pinMode(Relay, OUTPUT);
}  //<<<<<<<<<<<<<<<  move this
  
 digitalWrite(Relay, HIGH);
 delay(stayON);
 digitalWrite(Relay, LOW);

}  //<<<<<<<<<<<<<<< to here

And you need a loop() {}.

What loop? I want my script to only run once and then stop.

mihoc:
What loop? I want my script to only run once and then stop.

Put in an empty loop() function or it won't compile or put the code in loop() and only allow it to run once

int stayON = 1200000; //stay on for 5000 ms

Incorrect, useless comment aside, that value will NOT fit in an int, on most Arduinos.