Paladins and Clerics are required to worship a Deity. Other characters may choose to follow one if they wish.
A Cleric's power directly comes from a blessing of their deity.
Paladin's gain their powers from an Oath they take to their Deity.
Celestial Warlocks, are extremely rare, but having gained their powers from a celestial being, they typically follow a Deity. In such a case, if a Warlock abandons their celestial patron, they cannot grow stronger in the Warlock class unless they find a new patron.
Monks will occasionally serve a Deity in their monasteries.
Certain Druids choose to follow Deities as well.
Circle of the Moon Druids will occasionally worship Luna
Circle of the Land Druids will occasionally worship Gaia
Circle of the Shepherd Druids, almost always worship Thanatos, as his blessing gives them the rights to call upon the spirits that wander the world.
Theurgy Wizards will always follow a god matching their chosen domain.