^ Is Kirk saying it to McCoy? I thought it was Spock.
As for Kirk being a 'magnetic' leader: Of course he is. And apparently he's lucky enough to turn out that way too even in the alternate timeline.
But that doesn't mean he can just skip over all the intervening ranks. He has to spend *some* time as an Ensign, Lieutenant JG, Lieutenant, LCDR, etc. Those ranks are there to be used. You don't just skip ranks - that doesn't make sense. And it *definitely* doesn't make sense for a Cadet to go straight to Captain - not even if it's Kirk.
People do and have skipped ranks before in the military. And TOS-era Starfleet had a VERY high premium on captains' decisions, since they were more like 18th century naval commanders who were truly alone a lot of the time.
So yes, it is possible for a young Lieutenant made acting First Officer by a Captain, and later acting Captain (after relieving a former first officer who wasn't up to the task) to be left in command.
As an example, Jimmy Doolittle went from Lieutenant Colonel to Major General (three ranks, skipping Colonel entirely) in the span of 5 months. So while ranks are "meant to be used" not everyone progresses through them at the same rate, and sometimes ranks are NOT used.
At any rate, it's not totally outside the realm of possibility, especially if you're Kirk, a once in a generation hero.