Most people with laptops spend 1-2 hours. You'll get people working longer in the mid morning and mid afternoon. People who show up with laptops at 2 (1:30-2 is a common transition period), for instance, seldom stay past 5/5:30 (another common transition period). 5 or 6 hours tends to be the upper limit; most people can only sit in the same spot for so long. Obviously, it's very rude to this without buying drinks at regular intervals.
At many cafes, people that are ruder about it are almost never regulars. Any cafe that's popular enough to be filled up will have a network of regulars. Regulars chat, share books, go out for drinks and, among the programmer regulars, chat about startups, collaborate on projects or hire one another for contract work. You'd probably not be able to recognize it if you go in and people are all reading and on laptops at the time, but if you start frequenting it you'd start to pick up on it