How to make Timer Off without relay (Code)

Hi @iqbalts ,

welcome to the Arduino-Forum

I don't use tinkercad.
it is just a simulation but I assume at some point in time you build a real circuit.
NEVER connect something bigger than a sensor or a resistor-with-LED directly to an IO-pin. It is very likely that the device like your lamp will draw too much current and destroy the microcontroller.

The IO-pin that shall switch on/off the lamp must be connected to the base of a transistor
the transistor then can be connected to the coil of the relay. You have only one end of the relay-coil connected. The second is missing.

As using a relay requires an additional transistor simply use a resistor and an LED for your simulation. lighting up the LED makes the switching of the IO-pin visible too.

Your code uses IO-pin 1. The wiring uses IO-pin 13.

For switching off the lamp you need some kind of timing.
Your code has no timing yet.
There is a timing-option that is easy to use but very limited in where it can be applied
This option uses delay(). if you want to stumple over a lot of hurdles with more complex programs use delay()

If you want to be able to use timing professionally skip delay() and learn non-blocking timing.
I advertise my own tutorial for learning it

best regards Stefan