It is used for the object of a verb or preposition. Here’s a simple trick to use who and whom in the right way. If the question can be answered using he, she or another subjective pronoun, use ‘who’.
In practice, I would say: 'The girl you described as smart has failed the exam', but that's because I'm not sure if I should use 'who' or 'whom'. In conversational English, 'in practice' as you ...