If your oil light only comes on when you stop your vehicle it could be a bad oil pressure sensor or a bad connection to the oil pressure sensor.
You could also have a short to the sensor or loose wire connecting to the sensor or computer where it can move around and cause the oil light to come on when stopping.
If it goes out when you take off then it's likely the sensor or a short in the wire or your oil pump may be failing and not producing enough pressure at idle.
Another cause could be a clogged oil filter or your engine oil needs to be changed.
Every Time you change your engine oil you need to change the oil filter as well because the oil filters also become clogged.
I've known some people to change the oil but fail to change the oil filter and you must change the oil filter as well.