There's an element of chance or doubt implied in this expression. In this sense, happen to can nearly always be omitted without changing the meaning of the sentence. 'I (happen to) think he's right'.
'Do you happen to know the time?' ('Do you by any chance know the time?') is a bit politer than 'Do you know the time?'
''I happened to see Peter yesterday' is not much different from 'I saw Peter yesterday', though it implies that the sighting was unexpected.
But don't confuse it with the other usage of happen to:
'I don't know what's going to happen to me' ('...what will become of me').
'He has a broken leg; what happened to him? ('...what occurred to cause that').
Rover