I have to buy a lens and I have a Nikon d7000. I want to know which lenses have AF motors and which do not, as the D7000 has an AF motor built into the body. How do I tell whether a lens has a motor or not?
This question is only relevant if you have a camera without a built-in AF motor in the camera, like the D3300. In this case, you would need an AF-S lens that has a motor in the lens itself.
In your case, the D7000 does have a built-in AF motor. This means any AF lens, whether or not it has a motor in the lens itself, will autofocus.
Why is it important whether it has motor or not? The important question is: will it have autofocus on your camera body.
There is a large lens compatibility table on nikonians.org.
Look for the D7000 line, and make sure you scroll below to see the actual descriptions in "NOTES", especially of "NO!" (with exclamation mark) and "NO" (without exclamation mark).
In general, choose an auto-focus lens, do not use a "F3AF" (little chance :-)) , and you will have autofocus. "AF" lenses will not have 3D matrix exposure mode, and you will only have VR if you use a D or G type VR lens.
Now, if you really want to know whether there is a built-in motor in the lens, you can check it on the Nikon site, or at Ken Rockwell's site. Both show compatibility data, too, the latter also shows data for non-Nikkor lenses.