I always wondered if the gap between his time as Captain of the Stargazer and Captain of the Enterprise was because he was barred from captaincy.
In the Season 2 episode The Measure Of A Man, we learn that Picard had been brought to a court martial over the loss of the Stargazer, but that he was absolved of any and all charges brought at that time. So, he was briefly in trouble - but not in a career limiting way.
From the TV shows and movies, we don't have any clear indication of what Picard did between the Stargazer incident (Battle of Maxia) in 2355 and his taking command of the Enterprise in 2364. There is one hint that he may have been in command of another ship in the season 4 episode Legacy, as he describes his first encounter with Tasha Yar and mentions "his ship" responding to a distress call. Other than that, the shows are silent on these nine years.
There is an expanded universe novel, The Buried Age, that covers this gap and also provides some more details about the Battle of Maxia. After the court martial Picard returns to archaeology and takes a break from command. At some point he returns to a desk job at Starfleet, and finally applies for command again and is granted command of the Enterprise.