You could have a look at http://link.springer.com/chapter/10.1007%2F978-3-540-69295-9_19 or http://www.inderscienceonline.com/doi/abs/10.1504/IJAACS.2009.026783
The paper cited by Martin, and my own observation, say that there are various algorithms in use.
The oldest one are merely timers.
Beyond that, acoustic sensing of waiting vehicles in the lower priority direction. I think mostly now you don't find acoustic sensing, but pressure plates in the roadway.
Just from observation, the most advanced algorithms now sense traffic in all directions, and they will quickly give the green signal to the low priority direction if traffic is light in the high priority direction. Otherwise, the low priority direction is held up for longer periods of time, depending on traffic flow in the high priority side.
And more, if the low priority direction has a long line waiting, the light remains green longer, and red longer for the high priority traffic. But if the line is short, like just one car in the low priority direction, the duration of the green light will be extremely short.
So if you reach an intersection from the low priority side of the intersection, late at night when there is almost no traffic, you will often see the red light in front of you almost instantly turn green, and then yellow by the time you're in the middle of the intersection.
It depends upon the method of control, fixed time has no algorithm. Its a set of pre-determined plans. Then there is typical extension based logic, where I a detector is activated time extensions occur upto predetermined max's. Finally there are the types that are based upon algorithms. Unfortunately many of these are commercial secrets (such as MOVA by TRL), but are based upon gaps and occupancy of detectors to vary the holding of stages or transition.
for fixed time control you may use Webster algorithm or the method presented in HCM (Highway Capacity Manual). if the traffic flow variation is significant in a time period, actuated or semi-actuated control are useful where the data on flows are obtained by sensors and timing is determined according to these data and some rules, same as martin explained above. new mathematical methods such as fuzzy programming can also be incorporated in the process as well.