Trademarks are a special form of Intellectual Property that addresses the need of consumers to know the identity of the products they are buying. Unlike Patents and Copyrights, Trademarks are not based on the Constitution's Copyright Clause.  As a result, trademarks are not constrained by the language of that clausetrademarks do not have to be original works of authorship, the trademark regime is not tailored to "promote the Progress of Science and Useful Arts," and trademarks do not expire after a set period of time.
A Trademark requires three separate things. 1) A mark 2) used in commerce, 3) that is distinctive.  In addition, one must register the trademark on the principal register at the Patent and Trademark Office to receive the full protection of the law for the trademark (and be allowed to use '®').
A trademark holder may prevent other people from using the mark in certain ways, especially ways that would confuse customers about the source of a commercial product or "dilute" or "tarnish" the distinctiveness of a famous mark like "McDonald's". But many uses of the registered mark will not infringe the same word or image can appear in many trademarked and un-trademarked uses without each use infringing the others. For example, the word "Duke" appears in 336 different registered trademarks for goods ranging from shoes to barbecue sauce. These marks presumably do not infringe on each other, because users are not confused about the source of the goods. Moreover, none of the marks can stop ordinary use of the word "Duke" as a personal name or a word in the English language. Otherwise, trademark law would be a "homestead act of the English language," privatizing the words we use to communicate.
The first requirement of a trademark is that it be a mark. The Lanham Act (the trademark statute) defines the mark as "any word, name, symbol, or device, or any combination thereof...."  Obviously, this means that a trademark can consist of words and images, but, through trade dress protection, even something as simple as a specific shade of brown (UPS) or pink (Owens-Corning) can be trademarked for use on a specific product.  Trade dress protection protects functionally frivolous, but otherwise striking, identifying characteristics of a product. Trade dress protection may be available for a graphical user interface, if the interface is distinctive or has acquired a secondary meaning. However, since trademark protection cannot cover functional elements, any protection may be "thin," protecting only ornamental aspects of the GUI.
The second requirement is that the mark be used in commerce. Since trademarks are meant to identify goods, they must be associated with the goods themselves. The mark must either be attached to the goods, their packaging, on documents relating to the goods, or generally in display where the goods are sold. In addition, the goods must be sold or transported in commerce. 
The mark must also be distinctive. Distinctiveness is the most complicated aspect of trademarks. For instance, is the term "Proudly made in the USA" distinctive? No, it isn't. A court held that because the mark "must be used in a manner calculated to project to purchasers or potential purchasers a single source or origin for goods in question."  Unless it is clear that only one company uses this slogan on their products, this slogan is not distinctive.
Marks can be classified into four categories: generic, merely descriptive, suggestive, and arbitrary or fanciful. Each level has decreasing requirements as to distinctiveness.  Generic marks are insufficiently distinctive and can not be trademarked. Examples of marks that would be generic are "coffee" and "software" it is important to keep these words free for use, because every maker of coffee and software needs to use them to describe goods. Merely descriptive marks can be trademarked, but only if they have clearly developed a "secondary meaning," such that the consumers associate the mark with a particular source. For example, the brown color of UPS shipping trucks, the pink fiberglass insulation of Owens-Corning, or "auto-pages" for a circular of cars for sale.  Suggestive marks are marks that do not describe the product, but can evoke some aspect of the product. "Greyhound Bus" is a suggestive mark, since it is meant to suggest that the bus is a quick method of travel, like the greyhound is a fast dog.  Arbitrary or fanciful marks are marks that have no real meaning, and are entirely made up. "Kodak" is a fanciful mark for film; "Apple" is an arbitrary mark for computers.