As Kevin McCarthy is approaching his fifth defeat for a role as Speaker of the House of Representatives, I am interested to know whether there is a time limit (or special measures in place) until somebody must assume the role, in the event that the vote is unsuccessful each time.
There is no official time limit, just a point where the question becomes irrelevant. It is theoretically possible for the entire two-year term of this Congress to pass without ever electing a Speaker, at which point the next set of Member-elects can vote on a Speaker for that new session of Congress. The problem with letting the entire term pass is that the House can't do anything else (even swear in the rest of its members) until the Speaker is elected, so going two years without one means two years of no legislation passing, even the uncontroversial things that pass by unanimous consent.
So the practical limit is the first "must-pass" bill's deadline - the first bill which will shut down the government or otherwise cause mass disruption if it hasn't passed. This page lists several upcoming fiscal bills - whether they're "must-pass" really depends on what Congress considers to be such. For example, bad things will likely happen if the debt ceiling isn't raised by the time the government hits the current one (probably this Summer) and the US defaults on its debt, but there's no requirement that it be passed.
There is no time limit and the votes will continue until a speaker is elected as nothing can happen in the house until that happens. It is possible that they can change the vote from a majority of all votes cast to a plurality and they have done that in the past.
This shows that there have been 14 speaker elections with multiple ballots one taking 133 votes.
The record for most rounds of votes, according to the Office of the Historian of the House, is the 34th Congress, when Rep. Nathaniel Prentice Banks of Massachusetts was only elected speaker after 133 rounds and some two months of voting.
In this case it took two months of voting to get it done.
Dire circumstances could lead to unusual procedures. Twice before, in 1849 and 1856, the House agreed to a resolution that allowed a Speaker to be elected by a plurality. That move was something of a last resort, though, and came after 59 and 129 failed ballots. A majority of the whole House would need to agree to that resolution.