"Выучить стихотворение" in this context means learn the poem exactly how it is, word-to-word.