The previous post spells out flight time limits. However...flight time is only when the airplane is moving.
Duty time is all time between rest periods, including pre-flight, post-flight, and waiting around. Sometimes you might have a 4-5 sit between flights, where you just hang around the airport. Most companies will get you a hotel for anything longer than that but there is no law about that.
Max duty time is 16 hours, and you would then need at least 8 hours rest. But rest starts when you shut the airplane down, and ends when you return to the airplane 8 hours later. Walking through the airport, hotel vans, checking in, getting a new room because the toilet is clogged, eating, and hygiene must all be done in that 8 hours...so you really work 16, and get about 4 hours sleep worst case.
Some companies have better rules than the legal mins...max 14 hours duty is common.