To excel in graduate school you need a passion for your work. What kind of institution you should choose depends on how clearly developed your passion already is for a particular field or problem. Teaching institutions tend to do better in this regard than research institutions for the simple reason that effectiveness in supervision and teaching of students is weighted more heavily in hiring and promotion at teaching institutions. One way to choose a graduate school is by selecting a physical location where one would like to live. This approach can be shortsighted.
Graduate tenure is comparatively short.
Furthermore, few institutions are inclined to hire their own graduates, and their reasoning is sound. This question is perhaps the most difficult on my web site. It may not be easy, but it can be made substantially easier by making some of the considerations and common pitfalls explicit. A pitfall that can seriously impede your access to graduate school is to be overly precise about your interests, to the point that they match no faculty expertise. A common example in biology is of someone who becomes awed over one taxonomic group to which they are exposed and gushes about wanting to spend the rest of their waking existence working on it.