'AF' is a generic abbreviation for autofocus. But within the Nikon SLR/dSLR system, 'AF' refers to lenses which are focused by a motor in the camera body. While AF-S refers to lenses which are focused by a motor system in the lens. AF-S is a newer system, which allows for quicker and quieter focusing.
Both AF and AF-S lenses should work with all autofocus Nikon SLRs. However on a D40 or D40x, AF lenses (as opposed to AF-S) will not autofocus, because those cameras don't have the motor in the body. On all other autofocus Nikon SLRs, both AF and AF-S lenses will autofocus.