The measure of a QB is like any other players, how does he suit up against other players, what are his statistics like, what was the level of team he played on (it's eaiser to be 'great' when your team if full of all-pros), and how long and productive was the career.
Vinny Testeverde and Dave Krieg are among the leaders all time in passing yards, but I don't think anyone mistakes them for one of the great QBs. So stats alone aren't the answer.
QB's are only one part of the team. Montana, Elway, Aikman, Staubach, Brady, et al all showed signs of mediocrity when their teams were in down years. QB's get the love but the fact is Trent Dilfer won a superbowl. He was a very average QB.
Longevity is a good indicator, but can you blame a guy like Theisman who had his leg shattered by LT? Sometimes good players' careers are stopped short and you don't know how long they could have done it.
This is incredibly subjective and there isn't a true answer. The more relevant question in my mind is who were the greatest organizations, the ones that put the best talent together and won the most games and championships. Ranking individual players in a team sport is near impossible.