Check out this tutorial on thread quanta and scheduling
In particular:
Each thread has a quantum, which is effectively how long it is allowed to keep hold of the CPU if:
it remains runnable;
the scheduler determines that no other thread needs to run on that CPU instead.