Google's spam policies define link spam as creating links to or from a site primarily to manipulate search rankings. Note the two directions, and note the test: purpose.
The policy lists examples, including buying or selling links for ranking purposes, excessive link exchanges, automated link creation, and optimised anchor text in guest posts or press releases distributed on other sites. This guide shows you how to review your own links against that list.