Why does the 'Service Engine Soon' light come on only when you drive for a long time?

Get the car scanned and the codes should give you some guidance of where to start.