Kohi Café de Especialidad
Valencia
Two hours is safe almost anywhere, four is fine in most places if you keep ordering, and the limit is enforced by atmosphere rather than by rules. What actually decides it.

Two hours is safe in essentially any cafe. Four hours is fine in most of them if you order something every ninety minutes or so. Beyond that you are relying on the specific place being generous, and you will usually be able to feel whether it is within the first twenty minutes.
Almost nowhere posts a limit. Across the cafes we have read, fewer than one in ten has a time limit that reviewers mention at all, which is low enough that treating a posted limit as normal would be a mistake. What replaces the rule is atmosphere, and atmosphere is a worse guide because it is applied unevenly and never announced.
How busy it is at that hour. This dominates everything else. A cafe with six empty tables does not care if you stay until closing. The same cafe at half past one with people standing wants the table, and no amount of ordering changes that. The limit is not really a duration, it is a duration at a given occupancy.
What you are sitting at. A two-person table in a room of two-person tables is the cheapest seat in the house to occupy. A four-top, a window seat, or the one big shared table is expensive, and the tolerance for you shrinks in proportion.
How much you have spent per hour. Not how much in total. Cafes read rate, and the reason is arithmetic: the room needs a certain turnover per table per hour, and if you are not turning it you can cover it.
Nobody will tell you. The signals in order, and they escalate:
The table next to you gets wiped twice in ten minutes. Your empty cup is collected unusually promptly, which removes the visible evidence that you bought anything. You get asked whether you would like anything else, in a tone that is not a sales question. A member of staff starts standing near you doing nothing in particular.
By the second signal, order something or leave. Both are fine; sitting through all four is what makes cafes put up signs.
The four hours figure is a European and North American average, and it travels badly.
In Bangkok, Chiang Mai and Canggu, long stays are more normal, and cafes in areas with lots of remote workers are effectively built for them. This is visible in our data: those three cities run the highest laptop-friendly shares in the catalogue.
In Spain and Italy, the constraint is not the laptop, it is lunch. From roughly half past one, a cafe that also serves food wants the table for people eating, and no amount of coffee-buying competes with a lunch cover. The workaround is to move at one and come back at three, which is what the locals do.
In Japan and Korea, the paid study cafe exists precisely because this ambiguity is unpleasant. You rent a desk by the hour and nobody has to guess.
Ask. Not in a way that puts anyone on the spot: "I might be here a couple of hours, is that alright?" asked when you order, in any language, will get you an honest answer, and the answer is almost always yes.
The value is not the permission, it is that you now know. Everything unpleasant about this question comes from not knowing, and it costs one sentence to find out.

Sockets are the one thing cafe listings almost never record, including ours. Here is what we can and cannot tell you, and the reading tricks that work when the data does not exist.

A cafe costs about two euros an hour in coffee and a coworking desk about two an hour in fees. The money is a wash, so the decision is about calls, storage and the days you cannot afford a bad room.

A laptop friendly cafe needs five things, and most places have three. What we found after reading more than 2,000 cafes across nine cities, and how to judge one before you sit down.