Whether you need a common ground or not is a question of current flow between the different circut sections (see e.g.
this tutorial).
If there is a current path from one section (1) into the other (2), there also needs to a path back from 2 to 1 because current always requires a closed loop. This is usually a common ground.
It here is no current path, both sections do not need a common ground. But a common ground
can be used e.g. for technical reasons like PCB-layout, EMC etc.
A case where definitely separate grounds are required is when both low voltage circuits (
ELV, SELV) and high voltage circuits with voltages or power levels above the limits for ELV or SELV circuits are part of one system. In hat case the two circuits need to be isolated from each other (e.g. by photocoupler, transformers, protective impedance etc.) so any defect in the high voltage section does not pose a danger to someone being in contact with the supposedly safe low voltage section. There's abunch of interbational standards covering this kind of application and the necessayr measures.
Generally it is recommended not to mix grounds as currents from one section going through the ground of another section can have negative impact on circuit performance (cross coupling due to non-zero impedance of the ground path, be it a trace or a plane). A compromise oftne used is a star connection where different circuit sections have their own ground plane and these grounds are connected at one single point called star point (see e.g.
this discussion).
However, in recent years I have experienced another school of thought that recommends a single ground pane to absolutely minimize the impedance. In that case skilled placement of circuit elements can minimize cross coupling).
But I digress...