Any lens within a compatible mount type (F type mount is running for a long time now) is compatible with other cameras that use the same type of mount. The only thing is that some functions didnt exist on the older lenses so they obviously wont have that function even if your camera does. Autofocus is a good example. You can also put some very old CPU lens on; but they require to be registered within the camera (sounds complicated, but it isnt.)
So there is two types of lenses for the cameras I use. DX and FX. DX got a crop factor of 1.5X and FX is full Frame. You still can put a DX lens on a full frame like the D800, but the camera will operate it as a DX camera would.
After writing this, I checked wikipedia, and they tell the whole nine yard about it
http://en.wikipedia.org/wiki/Nikon_F-mount So I cant really add anything on the top of it