timer switching state

hi all
i'm having difficulty with a project i'm doing
i need to turn an led off if its been on for 5 mins and keep it off for 5 mins more

//t1=runtime;
//if(t1>=t1+300)
//{
//compressorpin = LOW; // Turn it off
//delay(300);
//}
this is what im trying but not working

It is impossible to help with what you have posted. Please post the entire program using code tags (the </> icon). That said, this can never work:

t1=runtime;
if(t1>=t1+300)

As using t1 on both sides of the compare is just silliness.

Delta_G:

if(t1>=t1+300)

I want you to think hard about this line for a minute. How can t1 possibly be greater than t1 plus some number. Can you think of any number you could put in for t1 where this would be true? can you think of any number that is greater than a number that is 300 more? I certainly can't.

With the magic of integer math and overflows... yes, it's possible.
If t1 is a 16-bit unsigned integer: anything 65236-65535 would work.
For a 16-bit signed integer it's about half that number.

Delta_G:
Do you think that is the OP's intent?

I know integers overflow, but I was trying to keep it simple for the noobie. Thanks for adding confusion with pedantry.

You ask an interesting question, you get an answer. Don't complain.

Delta_G:
Do you think that is the OP's intent?

I know integers overflow, but I was trying to keep it simple for the noobie. Thanks for adding , pedantry.

Isn't all programming an excessive attention to pedantry ?

Understanding how a computer stores its values (bits, bytes, etc) is a very important part of learning how to program the things. Using the wrong type can lead to all kinds of odd behaviour.
It also helps understanding why we always write

if (millis() - oldTime > interval) {
}

in this order and how it helps dealing with the millis() overflow.
No reason to try and hide stuff.