First contact is a term used to describe the initial meeting between two alien races.
One of the most historically significant first contacts was that between the Humans of Earth and Vulcans, in 2063. This meeting lay the foundation for what would eventually become the United Federation of Planets.
Misunderstandings are common in first contact situations, and can lead to unintended and tragic results. Such was the reason for the institution of Starfleet's Prime Directive, which generally forbade contact with races that had not yet developed warp drive. Decisions on initiating first contact were generally made by Starfleet's First Contact Office. (TOS novel: Prime Directive)
In the late 23rd and 24th century, alien races believed to be on the brink of developing advanced technologies would often be observed by Federation specialists in order to better understand the cultures in advance of first contact. These observations were conducted by nearby bases in system, from duck blind posts or by placing surgically-altered observers within the local population. (TOS novel: Prime Directive, TNG episodes: "Who Watches the Watchers?", "First Contact")
It should be noted that first contact does not necessarily represent an actual first encounter so much as the opening of relations (or, in the worst case, hostilities). For example, Earth and Federation Starfleet ships had several rogue encounters with the Ferengi prior to formal first contact in 2364. Another example was the case of exiled Cardassian poet Iloja of Prim, who eventually settled on Vulcan decades before the Federation and the Cardassians first started to interact.