In practice, yes. The drink is what pays for the table, the Wi‑Fi and the electricity. Almost nowhere will physically stop you sitting down with nothing, and almost everywhere will notice.
How much, and how often
One item on arrival, and another roughly every ninety minutes you stay. That is the whole convention. It does not have to be much — a second coffee, a pastry, a glass of water you paid for — and the point is less the money than the signal that you are a customer rather than furniture. If you are settling in for a long session, buying lunch there instead of bringing your own is the single thing that makes you welcome back.
Outside food is a separate question, and the answer is usually no. A café makes its margin on what it sells; eating a supermarket sandwich at its table while using its Wi‑Fi is the version of this that genuinely does annoy people.
If you would rather not spend anything
A public library is the honest alternative, and there are far more usable ones than people expect. Free, quiet by design, usually with Wi‑Fi and power, open to anyone, and with no obligation to buy a thing. University libraries are often open to the public too, at least for reading.
We list libraries alongside cafés in every city, for exactly this reason: the question "where can I work for free" has a good answer, and it is not a café.
What about chains?
The big chains are the most relaxed about it — that is part of what you are paying for, and a Starbucks or a Costa is not going to move you on. Independents are where the convention matters most, because a single long sitter is a real share of a small room. They are also, usually, the better place to work.