How long should I expect handlebar tape to last? I assume that if handlebar tape is grimy, torn, or peeling, it should be replaced. How long should I expect handlebar tape to last before it needs to be replaced? How often do most cyclists replace handlebar tape?
Anywhere from a month or two to years and years; how long handlebar tape lasts depends on too many factors to really answer this with a number. Of course, how often you cycle is a factor, but how good the tape is and how well it's applied also makes a difference. 

For example, gel tape is notorious for wearing quickly, as the gel gets pushed away from where you lean your hands. Good-quality cork tape without a lot of padding can be kept around nearly forever, unless you rip it or it starts to stink. Tape that's wrapped way too tightly can develop rips and cracks. And if you have cables routed under your tape, that can subtly move the tape around a little bit as you shift, causing you to need to rewrap or replace more often. 

How much weight you put on the bars, how tightly (or loosely) you wind the tape, how good the tape is - all these will change how long it'll take until you have to change the tape or simply rewrap it. 

One thing that's worth noting is that if you're wearing through the tape itself, you're probably putting too much weight on your hands or gripping the bars far too tightly. And cork or plastic bar tape that simply comes loose over time can be rewound.