How to keep the light on?

Hello, I am new in Arduino. I am doing a school project, but I encounter some problems.

I am trying to turn the light on for 5 second by clicking a button. When I press the button, the LED turned on, but if I release the button, the LED turned off immediately.

How could I turn the light on for 5 second without holding the button?

Thank you!

You could use delay (5000). Or you could use "millis" to note the time you pressed the button.

Oh That’s work!
Thx a lot!

but one more question.
If I want to turn on the LED by Two button.
For example,
One guy press the button(A). 5 seconds later, a girl press button(B)
If I want to turn the LED on after the girl press the button.
What function should I use?

I tried to figure out this programme for 5 hours…but I still fail. ><

I tried to figure out this programme for 5 hours...

delay (18000000UL);

One guy press the button(A). 5 seconds later, a girl press button(B) If I want to turn the LED on after the girl press the button. What function should I use?

I don't know of any functions that can determine the gender of the switch operator.

There are at least two ways of thinking about the passage of time. 1) Using "delay" is like setting an egg timer, and watching it all the time, and not doing anything until all the sand has run through. 2) Use "millis" or "micros". Note the time on the clock on a scrap of paper, go off and open a book, look at the clock to see if the desired period has passed, read the first sentence, look at the clock to see if the desired period has passed, read the second sentence, look at the clock to see if the desired period has passed, put the kettle on look at the clock to see if the desired period has passed, read the third sentence,

Sorry for my bad english...

What I mean is, I press button(A) first, and then I press button(B) after I press button(B), the LED light will turn on.