For children and adolescents (ie under 18 yr old), the "Jugendschutzgesetz" (law for the protection of adolescents) applies. Children younger that 16 yrs are only allowed in restaurants ("Gaststätten") in the company of adults. I'm not sure how long they are allowed to remain there in company of adults but my guess would be 11 p.m. However, if the restaurant is labelled a "night bar" or "night club", it's forbidden for them even in company.
So much for the law - perhaps you can see why Germany is sometimes labelled bureaucratic.

Sometimes, police will show up on the premises and single out the children under 16 yrs to check their i.d. but I've never seen that happen in pubs or restaurants.
Anyway, I hope that was at least a little helpful.