Poetry and fiction belong to what critics call different literary "genres" or different types of literature. The main distinction between the two is formal. Both short stories and longer fiction such as novels and novellas are usually written in prose. They are formed of ordinary sentences organized in paragraph form. Poetry, on the other hand, is written in verse. The essential unit of verse is not the sentence, but the line. Thus you can easily recognize poems on the page because they normally have ragged right margins.
Many forms of poetry have regular patterns of sounds, such as meter and rhyme, characteristics that are rare in fiction.
Most fiction has a narrative structure, meaning that it tells a story of some kind. Although there are certain types of narrative poetry, such as a type of long poem called an "epic", poetry does not necessarily have a narrative structure.