There are a lot of decisions that factor into whether they can hold a flight.
One of the primary drivers is crew duty time. Sometimes they cannot hold a flight whatsoever otherwise the crew runs out of federally-mandated duty time. If they don't get out in time then they need to find another crew or cancel the flight.
The other case is holding up the aircraft from downline flights.
The agent at a gate can see connecting passengers and whether they are expected to make a flight or not.