Most bacterial infections last between 10 to 14 days depending on the type of bacterial infection you have.
When you have a bacterial infection most times the bacterial infection will go away on it's own but it's best to go to the doctor and get antibiotics prescribed for the bacterial infection so you'll no longer be contagious sooner and the symptoms will go away sooner as well.
The antibiotics will help you feel much better sooner than waiting it out.
When you have a bacterial infection you're usually no longer contagious 24 hours after you start taking antibiotics.
Once you take antibiotics for the bacterial infection the antibiotics start killing off the bacteria and 24 hours later the bacterial infection should no longer be contagious.
So stay home from work, school etc for 24 hours after taking the antibiotics.
If you don't take antibiotics for your bacterial infection you are usually contagious for 24 to 48 hours after the bacterial infection starts going away.
The bacterial infection could last 1 week to 2 weeks and sometimes a bacterial infection may last as long as a month depending on what type of bacterial infection you have.