It really depends: I had two doctoral advisors, I wrote papers under the direction of both (separately): my first supervisor did not have her name on the paper; one of the papers I worked on with my second supervisor is joint, another has just my name (and yet a third has both our names plus a co-author).
The details are boring and not very enlightening, so I won't go into them, but the important thing in that in every case, there was a different, rational and very good reason why the supervisor name did or did not appear. It had to do with the cultural differences between France and the US, publication medium, and how the work was conducted.
In that respect, the etiquette question is similar as what happens when a colleague chats with you about your current research, or even better when they provide a crucial lemma or idea for your research. You should definitely acknowledge, but when do you offer co-author credit? In that case also, hierarchical considerations can easily come to the fore (if a person is clearly higher then the other in the pecking order, they can easily pass for a bully if they're not careful).
Even the area of math you work with is relevant (I've heard stories of people solving a problem in a group and the paper being published under a single name simply because the culture in that specific field does not give rise to many joint papers).