Captain

"Han Solo. I'm captain of the Millennium Falcon."

- Han Solo

In civilian life, a captain was an individual who was in charge of a starship. In military organizations such as the Imperial Navy or the Royal Naboo Security Forces, a captain was an officer of high rank with leadership responsibilities.

Galactic Republic
"My name's Rex, but you'll call me Captain or Sir."

- Clone Captain Rex

In the Galactic Republic, officers in the army and navy used the rank of captain.

Many clone navigation officers, some of whom held the rank of captain, wore a single-rowed plaque, with two red and one blue square (from left to right). In the Grand Army of the Republic, the standard Phase I clone troopers who held the rank of Clone Captain were distinguished by red markings on their white armor.

Confederacy of Independent Systems
"Captain! Show this droid what happens when you use that word"

- Osi Sobeck, to a droid commando captain

The Confederacy of Independent Systems used the rank of captain. In the Separatist Droid Army droids could hold the rank such as a BX-series droid commando Captain at the Citadel.

Galactic Empire
In the First Galactic Empire, there were captains only in the Imperial Navy.

On the Imperial insignia plaque of the rank, there were three red colored squares over three blue, or alternatively, a single row of of six yellow squares,  or three blue squares followed by two red.

Alliance to Restore the Republic
In the Alliance to Restore the Republic there were captains both in the army and the navy.

On the insignia of a rebel captain, there is two colored pips over each other. The color of the pips (red or blue) indicates the branch of service.

This is true of the early rebellion as well.

First Order
In the First Order, there were captains only in the navy.

The First Order ranks were marked by a combination of uniform color and arm insignia, worn on the left sleeve of the uniform. The First Order captains were wearing a gray uniform with a black armband edged in silver, bearing the name of a particular Imperial hero of the Galactic Civil War, Dillon depicted in silver Aurebesh letters.

Resistance
"Our plan, Captain? Not commander, right? Wasn't it Leia's last official act to demote you?"

- Amilyn Holdo to Poe Dameron

In the Resistance, there were captains both in the army, and the navy.

The rank badge of the Resistance captains bearing a colored vertical line. The red colored is in the army, while blue is in the navy.

In the Resistance navy, the rank of Captain was lower than that of Commander.

Non-canon appearances

 * William Shakespeare's The Phantom of Menace: Star Wars Part the First
 * Star Wars Epic Yarns: A New Hope
 * LEGO Star Wars: The Force Awakens
 * LEGO Star Wars: The Force Awakens
 * LEGO Star Wars: The Force Awakens