The important thing is that you do it only if there really is a follow-up king attack like in your example. At my level I know a number of players who will play this (or a similar sacrifice on f7/f2) on every opportunity that arises. But if there's no immediate follow-up, just "getting the king out" alone is no compensation for the bishop most of the time.
The Bishop Sacrifice
If you need help, please contact our Help and Support team.
The bishop sacrifice, sacrifices the bishop in order to get the king out in the open after castling. So tell me what you like about this sacrifice, what you hate about it, main lines, counters, and games you've seen. This is how it mainly goes.