A simple cellular automaton to model traffic flow is used to analyze the impact of traffic lights on travel times. The model is investigated on a stretch of road with open boundaries, where the inflow is driven stochastically, but the outflow is controlled by a traffic light with periodically changing outflow rates. Especially in the transition regime from free flow to oversaturated flow, the detailed space-time structure can be used to derive analytical lower and upper boundaries for the travel time function. The analytical results have been verified by a simulation study. The function displays a strong non-trivial dependency on the length of the system, which is at odds with a well-known formula derived almost 50 years ago by Webster. Such a model is interesting both from a theoretical point of view and for applications.