It's not desirable to stay on an antibiotic for a very long time, because it destroys good bacteria and good intestinal microflora. Over time, also, bacteria can start developing resistance to it. (This is also a problem, however, if you stop taking antibiotics too soon, before all the bad bacteria have died.)
However there are times when for medical reasons long-term dosage with antibiotics is needed, especially if infection would be a particular danger.