Commander
From Holowiki
In Starfleet, a prerequisite to becoming a commander is by taking the Bridge Officer's Test. As commanders prove their leadership ability over time, they are considered for the difficult and highly competitive promotion to Captain.
Proper naval parlance says that, even if a naval vessel is commanded by an officer whose rank is commander, that officer is still able to be referred to as a captain while on the deck of their own vessel.