To "bother" someone means to annoy them or take up their time. So the phrase "Sorry to bother you" is an apology for using up some of a person's time.
Here are some situations in which you can say "Sorry to bother you":
When you ask someone a question that they don't know the answer to, you can respond with "OK. Sorry to bother you."
A: Do you know where the nearest subway station is?
B: Sorry, I'm not from around here.
A: OK. Sorry to bother you.
You can also introduce a question with this phrase. Especially when you're talking with someone who's important and busy in a business situation, you can start your question like this:
Sorry to bother you. Can I ask you a quick question about the budget report you sent me?