Pirate

A pirate is an individual who robs others of their money or possessions, typically aboard their ships or starships. A pirate who operates on behalf of a government is known as a privateer.

In the 1980s, pirates were engaged in whaling on Earth. 

During the 22nd century, trade routes near Earth were often ambushed by Nausicaan interstellar pirates. 

In the 2150s, the crew of an Osaarian merchant ship turned to piracy to survive after being trapped in the Delphic Expanse. They attacked the Enterprise in 2153, after it had been disabled by a spatial anomaly. 

In 2154, Harrad-Sar commented that he preferred commerce to piracy, although he stated that he would resort to plundering "when the situation calls for it". 

The Orions often operated as pirates in the 23rd century. 

James T. Kirk once remarked that he always thought Mr. Spock was a pirate at heart, due to his counterpart from the mirror universe fitting in to such an environment "so easily". 

Mercenaries and pirates were still active in the 24th century. The USS Enterprise (NCC-1701-D) nearly fell prey to pirates several times. Ferengi pirates took control of the ship but were thwarted by Captain Jean-Luc Picard and several other members of the crew who, due to a transporter accident were children. Picard had run into Ferengi pirates before, as captain of the USS Stargazer years earlier. Additionally, a group of mercenaries boarded the Enterprise while it was undergoing a Baryon sweep, to steal particles used for explosives. Picard thwarted them, and managed to keep the sweep from killing him. 

In 2372, the USS Defiant (2370) repelled an attack by Breen privateers on the Bajoran colony of Free Haven. 

Apocrypha
The video games Star Trek: 25th Anniversary and Star Trek: Judgment Rites, set in the late-2260s, featured a clan of pirates known as Elasi. Elasi ships were a hodgepodge of old Klingon battle cruisers, which were fast and maneuverable but fragile. These frigates were equipped with phasers and photon torpedoes.

Towards the end of Star Trek: 25th Anniversary and throughout Judgment Rites, the Elasi made an alliance with the Romulan Empire, who provided the pirates with cloaking devices. The Elasi retrofitted their ships with these devices, along with other modifications such as 3 forward firing photon torpedo tubes. Elasi pirates were responsible for 46 attacks against the Federation between 2267 and 2269. During that time they were considered a "Class I Threat" to the Federation.