Use this phrase when you have to give someone information that they won't like. For example, a waiter can say this to a customer:
I'm very sorry, sir, but I'm afraid we're all out of the salmon.
You can use this phrase to say "no" to a request:
A: Excuse me, can you spare some change?
B: I'm afraid not.
"I'm afraid..." is a little bit formal.
Notice that this phrase doesn't actually mean that you're frightened; it's just a polite way to show that what you're going to say will be disappointing to the listener.