Shane, there were slight variations between railroads, and over the years. But in general:
"Class lights" are an appliance (permanently) installed on the front of a LOCOMOTIVE. "Markers" are signals (temporarily) applied to the rear of a TRAIN.
As others have said, class lights are extinguished on locomotives powering scheduled trains. They are turned on and left white for extras, and they show green for advance sections of scheduled trains.
There were quite a few different models of class lights, and they switched from white to green in different ways. One common way was a lever on the outside of the housing that flipped a green filter between the bulb and the lens.
"Markers" designate the rear of a train (among other reasons, so that it can be distinguished from a cut of cars in a siding). Red is displayed when a train occupies the main track, and yellow when it occupies a siding. Markers could be flags or lights.
So, a light engine running extra on some railroads might have both class lights (and flags) at the front, and red lights (or flags) on the rear of the tender.
The best way to make sure for what you want to do is to find the Book of Rules for the railroad and the period that interests you.
Below is a link to a Book of Rules from the Pennsylvania RR in 1956. Lots of good information there.