A hundred years ago, even in the US, men used last-name-only in addressing:
- Those of either sex who were distinctly inferior, socially or professionally
- Male equals with whom one was on familiar (but not necessarily intimate) terms
- Boys and young men to whom one stood in a professionally superior but socially equal relationship
They added the title in addressing:
- Social and professional superiors
- Social or professional inferiors of either sex entitled, by virtue of age or status, to a distinct mark of respect
- Male equals with whom one was not on familiar terms
- All women who were not distinctly inferior
One addressed by the first-name-only
- those of either sex with whom one was on affectionately intimate terms.
- children
- contemptibly remote inferiors
Women followed the same rules, with the sexes reversed, except that they addressed women equals by last-name-only only in (then rare) professional or school contexts, and the first-name "intimacy/familiarity" line seems to have been drawn a bit less stringently.
In the US, over the course of the last century, almost all uses have been swallowed up by first-name-only, except where tradition or professional discipline enforces use of titles to eminent superiors. I believe the same is coming-to-be in Great Britain, too; but you must consult a native speaker on that.
The use at Hogwarts in the Potter books reflects very traditional public-school practice, which spiceyokooko addresses in more detail in the Comments.
EDIT:
I am moved to add, in light of the discussion in the comments, that it would be gravely discourteous (not to mention deleterious to discipline) to omit a deserved title when addressing anyone in the presence of his or her subordinates.