Rap and Hip hop are both forms of artistic musical composition and performance. Rap is usually just the vocal part of a Hip hop performance and generally doesn’t include dance and music. Rap performers typically sing or speak rhyming words to a well-defined or noticeable beat.
Hip hop usually includes dance and music and may or may not include a Rap song. It might help to think of famous artists to better understand the difference. Tupac Shakur and Jay-Z are two very well-known Hip hop performers. Eminem and Snoop Dogg are two very well-known Rap artists.
Even though these 2 genres are often grouped together into a single category, there are differences between the two, and some of the differences are even significant. Something that used to be an identifier but is not really recognized too much anymore is that hip hop described the culture and rap music was one of the subcategories of hip hop.
Other subcategories of hip hop were break dancing, graffiti and DJing. As time went on the difference between the two was basically that hip hop was usually slower and rap was very fast and had a stronger tempo. Nowadays rap can be slow too so the lines get further blurred.