There is no single answer, but a rough guide helps. The right interval depends on your cut, how fast your hair grows and how sharp you like the shape to stay.
As a general rule, shorter, more precise cuts need attention sooner than longer, layered styles.

Crops, bobs and short men’s cuts look best refreshed every 4 to 6 weeks.
Every 6 to 8 weeks keeps the shape and removes split ends.
Every 8 to 12 weeks is often enough if you are growing it, with layers kept tidy.
A small trim now and then removes damage and helps it grow healthier.
Coloured hair can be more fragile, so regular trims help it look its best.
Split ends, a lost shape or hair that is hard to style are the usual signs.