If you got bad gasoline at a station how long would it take to affect your engine if you were driving on the interstate?
Until you refill at another gas station.
I once filled up and got a few miles before it suddenly stopped. I figured out what it was and waked back to the station, which had a vent problem on a tank. There were several cars that had only made a block or two, I had got the furthest. I suspect most cars would not make it all the way to the end of the exit ramp.
Lots of variables here. No simple answer. It would depend on how much gas was in the tank, how much you added at fill-up, and what, exactly was “bad” about the gas.
The answer could be anywhere from a few blocks to many miles.
We need more information.
If the ‘bad’ in the gas is water, you probably will not get more than a mile or so. If the ‘bad’ is gummed up gas or rust and debris in the gas, you might get considerable distance before the fuel filter catches enough of the debris to restrict fuel pressure at the injectors to a low level where the engine cannot get enough gasoline to run correctly. If the ‘bad’ in the fuel is an adulterant like diesel or another foreign petrochemical, the effects could be noticeable over a range to periods.
I remember a NTSB airplane incident report where a twin engine turbosupercharged cabin class airplane was misfueled with Jet-A because the lineman saw turbo on the engine cowling and assumed it required jet fuel. The plane made it off the runway, and climbed to 500 feet before both engines had quit turning. Post incident tear down of the engines showed massive detonation damage – pistons holed, cylinders galled, broken rings, burnt exhaust valves, etc.