Based on the events in the movie, apparently all you have to do is stand in one spot for more than thirty seconds and someone will give you command of the Enterprise. Most likely as they're headed out the door at a full run. Aieee, YOU do it!
As I said earlier, that struck me as amusingly odd from my very first viewing of the movie - it's like being captain is cancerous or something. Hell, we even see TWO people voluntarily submit themselves to certain death at Nero's hands rather than stay in that chair.
Starfleet in general seems awfully lax about a lot of rules - I agree that the whole Bones-sneaking-Kirk-aboard injection scene, while kinda funny and slapstick, is also clearly court martial bait.
But even with all that, I have to say that I didn't find it outlandish that Kirk got the captain job. Of course that's not how it works under normal military protocol, but there is such a thing as a battlefield promotion, even in our era.
There are even such things as battlefield commissions, in which enlisted men become instant officers as a result of heroism or circumstance, without ever spending a day in OCS. And the movie shows us plenty of hints that Starfleet is in *ahem* a bit of disarray that day.
There's the additional wrinkle that Kirk finds out from Old Spock that he MUST become the captain, and has to do it sooner than he might have otherwise. So he's got motivation to grab the chair however he can get it.
It's also implied that when the crisis has passed, Kirk still keeps the job at least partly due to the behind-the-scenes machinations of Old Spock.
Again, while the details can be quibbled about, the general spirit is very original Trek - those guys were always breaking the rules left and right, it's just that they kept saving the galaxy by doing it and so Starfleet tended to look the other way. Crazy kids.