On Asking “the Question”

When is it ever acceptable to ask a person’s age? In other words, when is the question relevant?