I'm a master's student in CS at a top-20 school (in the US), in my second year (although it feels like my first year since I had to play catch-up last year and mainly took undergraduate courses).
My current strategy for applying to PhD programs is to apply only to top-5 this year, and if I don't get in, apply to a fuller range of programs (top 50 or so) next year.
But because I don't have any publications in spite of having worked on 3 research projects, it doesn't sound like I have much of a chance of getting into top-5 programs this year anyway (and applying actually kind of sounds like a waste of time). So if and when I get rejected from them, I would take the next year to try to get a publication and also retake the GRE (my quantitative score is 164--in the 87th percentile when apparently the top programs expect a percentile in the high 90s).
However, although my GPA is 3.9 now, who knows what it'll be next year. Or if I'll manage to get a paper accepted. So does it make more sense for me to just try to get into whatever PhD program will take me now or to take a year to work on strengthening my application? As this post says, apparently the bar you have to clear to be considered an acceptable candidate rises every year anyway, suggesting that anything I do over the following year won't have much of an impact on my prospects.