Opportunity attacks do occur, but most certainly less frequently than in 3d edition.
In5th edition oa is only triggered by moving out of reach of an enemy. The enemy can use its reaction to make a single attack with a melee weapon.
Things that dont trigger oa's are:
* casting a spell when next to an enemy.
* using disengage action before moving out of an enemy reach.
* firing a ranged weapon when next to an enemy.
* forced movement due to push or pull effects.
Of course, there are effects such as feats which modify these conditions.
* warcaster allows casting a spell instead of using a melee weapon.
* polearm master allows triggering oa's when a enemy moves into your reach.
* sentinel allows oa's even if the enemy usedbthe disengage action.