I don't know if there is a set # of places you "have" to rank. The majority of US grads go down no farther than 4 or 5 on their list. In my graduating med school class there were a couple of people who went down to #8 or so, but they were in nasty competitive fields like Ortho or something. It's very hard to say at what point you are "safe." You might be safe by ranking only one place. It all depends.
There is no reason to not rank as many places as you can (they start charging you after about 15 I think). Unless, of course, you visited a place and you would rather try to scramble than go there, which is possible. The scramble is bad. Don't look at past years results and think "that might not be so bad." It is bad. Stressful and difficult.
There is no magic number that applies to everyone though, unfortunately. But if you interview at a range of places and include some less competitive places (I know, it can be hard to tell whether a program is non competitive) you shouldn't have trouble. If you are ranking 5 programs but they are all high power programs that can be risky.