I have a light fixture with a green a white and a black wire. What is the green for?
Green is the ground wire. It connects to the ground conductor in the box and bonds it to exposed metal portions of the fixture as a safety measure.

The ground conductor is typically a bare wire inside the same cable as the supply hot and neutral wires. But in some older systems, ground is conducted via a metal jacket or conduit, in which case you would also have a metal box. In those cases, the green wire should be bonded to the box.