This sort of question is probably in bad taste for math.stackexchange, but is probably in high demand. (I tried to start a site on Area 51 to house questions like this, but my request was closed due to the existence of math.stackexchange.)
I am advising talented students about graduate school. I believe that the most important thing one must be sure to do is pick the right PhD thesis advisor.
Question: What is your best advice on picking a good thesis advisor. (For the sake of levity, feel free to answer an opposite question regarding how to pick a bad thesis advisor. Just be sure you are clear whether you are indicating how to pick a good or bad advisor!)
My lecturer in homological algebra, Hal Schenck, has some advice on this http://www.math.uiuc.edu/~schenck/grad.html (item II in the list). I quote the relevant paragraph:
"1) Compatibility. It is really important that you and your advisor get along well; grad school is difficult enough without having a chilly (or worse, hostile) relationship with your advisor. The best time to figure this out is BEFORE you ask someone if they'll work with you. One way to determine this is by taking a course with the person, and seeing how you interact when you go to office hours to ask questions. It goes without saying that you should make sure you do a good job in the class, because if you do poorly, it is likely that the potential advisor will not be interested in taking you on as a student.
2) Track record and reputation. It is important that your advisor be respected as a scholar. You will quickly find that one of the first questions mathematicians ask a graduate student is: "and who is your advisor?". You may also want to find out how many theses the professor has directed, and how many students have dropped out (this should be done tactfully, of course, by talking to former students or the director of graduate studies).
3) Good thesis topic. Most professors supervising dissertations have a set of problems that they think might make an appropriate thesis; you should ask about this, 'cause getting a bad problem can cause you to waste years of your life."