...
Data graduated the Academy in 2345 and spent 3 years as Ensign and 12 as Lieutenant.
He was Lt Cdr from 2360 and spent 19 years in that rank and role before being promoted to Commander and getting First Officer.
Compare with Picard, who went from Graduation to Lt Cdr in 6 years. Sisko was similar, and Riker did it in 4. Data clearly wasn't capable, so no wonder he didn't get promoted or move on. Normally it looks like you spend the same amount of time as lt cdr as you do going graduation->lt cdr. That would have put Data's promotion to Commander around Generations, perhaps his behaviour there with his emotion chip pushed this back, and wanted to experience emotions more on the Enterprise before leaving...
W
Data was a Lt. Cmdr. in 2364, TNG's first season. STAR TREK NEMESIS was 2379, so he was that rank for 15 years, not 19.
And Data was VERY capable. He simply didn't have ambition.
He was promoted to Lt Cmdr in 2360 having spent 15 years as ensign + lieutenant
According to the TNG episode "Datalore" in the first season:
LAFORGE: This once was rich farmland. I'd say something like twenty to thirty years ago.
DATA: I was discovered twenty six years ago.
So Data was discovered "twenty six years ago", which should be 26.00 to 26.99 years.
LORE: Promises he later proved to be true. Which made you and me possible, brother. Our beloved father. Will I soon have a uniform like that, brother?
DATA: If you get one the way I did, Lore, it will mean four years at the Academy, another three as ensign, ten or twelve on varied space duty in the lieutenant grades.
If Date was promoted to lieutenant commander immediately before "Encounter at Farpoint", he would have been a lieutenant for tenor twelve years -10.00 to 12.99 years before. Thus Data was promoted to Lieutenant 10.00 to 12.99 years before before "Encounter at Farpoint". Data graduated from the Academy and was commissioned an ensign three years - 3.00 to 3.99 years- before that, or 13.00 to 16.98 years, And Data entered the Academy four years - 4.00 to 4.99 years - before that, or 17.00 to 21.97 years before "Encounter at Farpoint". Which would seem to indicate that Data spent about 4.03 to 9.99 doing something unknown between being discovered and entering the Academy.
So on one hand, Data might have been promoted to lieutenant commander immediately before "Encounter at Farpoint".
And on the other hand, Data might have entered the academy immediately after being discovered.
If Data entered the Academy immediately after being discovered, and if four years there were 4.00 to 4.99 years, Data graduated and was commissioned an ensign about 21.01 to 22.99 years earlier. If Data was an ensign for three years - 3.00 to 3.99 years - he would have been promoted to lieutenant about 17.02 to 19.99 years earlier. If Data was a lieutenant for ten to twelve years before being promoted to lieutenant commander, he would have been promoted to lieutenant commander about 4.03 to 9.99 years before "Datalore".
So on one hand, Data could have been promoted to lieutenant commander immediately before "Encounter at Farpoint", and on the other hand Data could have been promoted to lieutenant commander about 4.03 to 9.99 years before "Datalore". Or sometime in between those two hands.
According to the official, though sometimes incorrect, chronology "Encounter at Farpoint" and "Datalore" happened in the year 2364 of the calendar used in that era, and Data was "killed" in the movie
Star Trek: Nemesis in the year 2379.
If Data was promoted to lieutenant commander right before "Encounter at Farpoint" sometime between 2364.00 and 2364.99 and was killed sometime between 2379.00 and 2379.99, Data was a lieutenant commander for about 14.01 to 15.99 years. If Data was a lieutenant commander for up to 9.99 years before "Datalore", he might have been a lieutenant command for up to 24.00 to 25.99 years.
Therefore, a rough estimate is that Data was a lieutenant commander for about 14.01 to 25.99 years.