Yes, the workgroups are independent of each other. This means that when one workgroup has finished its work, it is released and the next workgroup can start its work while other workgroups are still in progress. Even better! If there are two different compute shaders (different code) that need to be executed, the released workgroup capacity can be used by the second compute shader workgroup while the last workgroups of the first compute shader are executed at the same time.
When branching, the total calculation time of a compute shader can vary. Let's take a look at an example:
Example:
Let's assume we have 20 workgroups whose program code has a branching option. And only 1 workgroup takes 1.5 times longer because of this branching, let's call it workgroup 1.
Let's assume that your GPU can process 19 workgroups simultaneously. So the GPU loads 19 workgroups and after one of the workgroups has finished its work, the last workgroup is loaded.
The minimum execution time of all workgroups would be: $2 * x$, where x is the time of one of the 19 fast workgroups.
But you can also be unlucky. That is, the 19 fast workgroups are executed first, and workgroup 1 (the slow one) is executed at the end. Then your execution time is: $x + 1.5 * x = 2.5 * x$.
To be honest, there is a time offset for loading the workgroups and memory etc. which is not specified in this form to keep it clear.