I've sat in numerous pubs, coffee shops, restaurants and other social places by myself for many years, and in my experience people just let you be by yourself, doing your own thing.
(Just for clarity, I do have friends. I'm the sort who likes going out by themselves as well, though).
Although I've had people I don't know come and talk with me, and I'm friendly when they do, it's very unusual. I would bet on that happening maybe 1 in 20 nights out, and 1 in 50 times at a coffee shop. I would not say it takes hours, I'd say it takes weeks to months.
Sometimes I notice other people by themselves, usually old men, pint in hand for hours, saying and doing nothing. To me they look really sad like that and I don't feel like approaching them at all. I feel empathy but don't want to be involved. Myself, I've usually got a book or computer, or these days my phone. Maybe that makes me less approachable, but I'd rather that than doing nothing at all for a night.
However, even at times when I've gone out and just sat without any props, warming my hands by a fire or, seasonally, a nice christmas tree, nearly everyone is part of a small group of their own, and the phenomon you described where "someone will talk to you just because they notice you've been sitting there not talking to anyone" is still unusual.