The term for a poem of mourning or lament for the dead is an elegy. In modern English usage, an elegy is usually a serious, reflective poem written about loss, death, or remembrance.
The word comes from the Greek elegeia, which originally referred to poetry written in elegiac couplets: a pattern pairing a hexameter line with a pentameter line. In ancient Greece and Rome, elegiac verse covered more subjects than mourning alone, including love, war, and personal reflection. Its meaning narrowed over time, especially in English literature.
A well-known example is Thomas Gray’s “Elegy Written in a Country Churchyard,” which reflects on mortality and ordinary lives. John Milton’s “Lycidas” is a pastoral elegy mourning the death of a friend. An elegy should not be confused with a eulogy: a eulogy is generally a speech or tribute, while an elegy is a literary work, most often a poem.