It really depends on the size of the ship and the command the ship falls under.
An 87' patrol boat has a lieutenant junior grade (O-2) CO or sometimes a senior enlisted (such as an E-8 or E-9) OIC (Officers-in-Charge).
A 110' patrol boat will typically have a lieutenant (O-3) CO, and a few have a chief warrant officers (CWO) CO. The 110's working with PATFORSWA had lieutenant commander COs (that may have changed to lieutenants, I'm not 100% sure).
For 87's and 110' sometimes a more experienced senior enlisted or CWO is used because their area of operations are more extreme and require a few more years experience than an O-2 or junior O-3 might have.
A 140' ice breaking tug will typically have a lieutantant CO, but if the 140' also has a barge associated with it, it's a lieutenant commander (O-4) command.
The new 154' fast response cutters have lieutenant COs.
I think the 175' coastal buoy tender like the James Rankin is the largest lieutenant command.
A white hull 210' cutter has a commander (O-5) CO.
A black hull 225' has a commander (or maybe senior lieutenant commander) CO.
The red hull 240' Mackinaw has a commander CO.
The while hull 270' cutters have commander COs.
The 282' Alex Haley has a commander CO.
The 295' Barque Eagle has a captain (O-6) CO.
The white hull 378' cutters have captains COs.
The red hull 399' polar roller ice breakers have captain COs.
The white hull 418' national security cutters have captain COs.
And the red hull 420' Healy has a captain CO.
CONDENSED AFLOAT:
RANKS:Unit size they may command (with the understanding that there is some give when considering promotions before or during a command)
Senior Enlisted (E-8 or E-9): 87' Marine Protector Class patrol boats
Chief Warrant Officers (CWOs): 87' Marine Protector Class patrol boats, 110' Island Class cutters
Lieutenant Junior Grades (O-2s): 87' Marine Protector Class patrol boats
Lieutenants (O-3s): 110' Island Class cutters, 140' Bay Class icebreaking tugs, 154' Sentinal Class fast response cutters, 175' Keeper Class buoy tenders
Lieutenant Commanders (O-4s): 140' Bay Class icebreaking tugs (with barge), and MAYBE 154' Sentinal Class fast response cutters (came out after I had left so I'm not 100% sure) and maybe 175' Keeper Class buoy tenders.
Commanders (O-5s): 210' Reliance Class cutters, 225' Juniper Class cutters, 240' USCGC Mackinaw, 270' Famous Class cutters, and the 282' USCGC Alex Haley,
Captains (O-6s): 295' USCGC Barque Eagle, 378' Hamilton Class cutters, 399' Polar Class cutters, 418' National Security Cutters, and the 420' USCGC HEALY
Now a bit more detail. The entire Coast Guard falls, at some level, under Coast Guard Headquarters, below HQ the CG is divided in half between the Atlantic Area (LANTAREA) and the Pacific Area (PACAREA). Below each area are a number of districts (LANTAREA has districts 1,5,7,8 and 9, and PACAREA has districts 11, 13, 14, and 17). Each district has a number of sectors (such as Sector Boston or Sector Long Island Sound). Under sectors are individual units.
Cutters work for different commands. An 87' cutter works for a Sector most of the time. They are sector units A 225' is a District unit. A 210' is an Area unit.
Cutters also have different crew sizes. You may look at a 225' and think, it's bigger than a 210' cutter, it must have a bigger crew, but in fact it's much smaller, crew-wise. A 225' may have a crew of 30 or so, while a 210' has a crew of 70.
So, combine the size, the kind of unit it is, and the crew size, and you'll have SOME idea of what kind of commanding officer will work on it.
These CO ranks aren't set in stone. Some commands may take a senior or junior officer in that rank. I had a CO on my 210' who was a senior commander. A year before he left he made captain. Some officers may go to their units "junior" such as a commander going to a 378' as the commanding officer. Sometimes they'll "frock" that commanding officer, so he wears his new rank before he is officially that rank (as in, I'm the CO on the USCGC Sherman, I'm technically a commander but I'll be promoted July 1. I'm set to report to the cutter June 1. I can be "frocked" to wear my captains stuff until I'm officially a captain. it helps the crew associate the new CO with the rank of the position he/she's entering)
Way more info than you asked for.... some of this could change or may have already changed since I got out, but that's the generall idea of ranks as I remember it. I'm much less familiar with the black hull fleet than the white hulls, so I get a little confused on the 175'-225' buoy tenders.
Hope this helps!