A link farm is a website (or a group of websites) created only for the purpose of increasing the link popularity of another site by increasing the number of incoming links. A link farm usually looks like a regular web page, but the majority of the content is hyperlinks -- often random and unrelated -- to other websites.
Link farms can be advertised as services to build up your content. They are often set up by creating a network -- one that is often created with the sole purpose of gathering a number of locations from which to point at a website. Because Google dislikes links between unrelated sites, some link farms divide their links into categories or a directory.
Link farms were originated in response to Google's ranking algorithm, PageRank. PageRank thinks of links as votes, where a page linking to another page is casting a vote. Therefore, pages with the most links were deemed valuable. Link farms were created to help increase PageRank, however, in recent times, Google and other search engines have adapted their algorithms to prevent link farms from appearing at the top of search engine results pages (SERPs).
Web sites that have created link farms can be penalized by Google and other search engines.
Link farming is considered a "black hat" method of search engine optimization (SEO) because the content on the web sites linking to each other is often not related, not created by a human (it can be created using programs or services) and is often of a very low quality. Search engines can detect link farms easily and they shouldn't be seen as a legitimate long-term search optimization strategy.
More information on link farms:
Watch a video at SEO Moz about why link farming is bad for SEO
Check out Google's guidelines on link farms