Should men stand when a lady enters or leaves the gathering?
This formality smells like old cheese and old ways. However, it is appropriate for gentlemen to stand to either greet or to bid farewell a lady of significant age or importance. It is a courtesy paid with respect, but also lends the gentleman as a gregarious and charming sort of individual. But please, stand from a genuine desire to! Otherwise the action is meaningless.
Modern women may mock such a gesture as over the top, but it should be appreciated with a smile and a gentle nod of the head. Singling out a gentleman for standing could be seen as crass. On the other hand, it is not a custom we should expect. When a lady leaves in the middle of a meal, for instance, all the present gentleman standing would only add to the disruption of her exit and cause her embarrassment.