Im pretty sure Im not doing this right because I replaced 255 with 180 for 3 minutes and nothing changed.
delay() uses milliseconds so delay(1000) would equal 1 second. You would not likely notice the difference in delay between 180 and 255. If you want to delay for 3 minutes then you do delay(180000). Also be aware you need to use long and not int as 180000 is to big for int variable type.
int val = analogRead(5);
val = map(val, 0, 1023, 0, 180);
These two lines do nothing useful as val is not used in rest of program.
delay(sensorValue);
As sensorValue is a direct reading of the analogue port it's value could be between 0 and 1023 so the maximum time the LED would be off is just over one second, the minimum time (and some percentage above that) you would probably not notice the off time at all due to persistence of vision.