My best friend and I are planning to go see Logan soon, but she doesn't have the time to watch eight X-Men movies beforehand.
What are the most important movies to have seen before Logan?
Realistically, you don't need to see any of them, as long as you are aware of who Logan and Charles Xavier are and what their basic personalities are like. This movie was filmed in such a way that it's stand-alone.
There are a few casual references to X-Men 1 and the story sort-of picks up where X-Men: Age of Apocalypse leaves off (as far as Logan is concerned, anyway). But you don't really need to know those stories, only that the X-Men did exist and the world did know about mutants.
If you did want to catch up on Logan's personal backstory, since Logan takes place in the rebooted timeline, you really only need Days of Future Past and Age of Apocalypse. Those two movies will explain the key piece of history you might need -- how the bad guys ended up knowing so much about mutants. The the other movies (X-Men 2, X-Men 3, X-Men Origins: Wolverine) have all be mostly erased from the timeline, so other than giving you a general sense of Logan and Xavier as characters, you won't get anything meaningful out of them.
Logan is fairly self-contained, so you don't need a ton of backstory, but a good understanding of Logan's character does help. The ones I found most important were:
Following this list will give you a thorough understanding of the X-Men universe and Wolverine's background.
X-Men and X-2 are the most important, especially if you're not already familiar with the X-Men universe from other media such as comics or animated shows. These two films will get you oriented in the universe and introduce Wolverine and his backstory. X-2 is especially important for Wolverine.
X-3 is only necessary if you want to watch The Wolverine. I haven't seen The Wolverine, so it's not essential, but it sounds like it clarifies some of the plot threads a little, especially as regards Days of Future Past.
You could skip Days of Future Past at your discretion, but I like the extra perspective it gives to Logan. It sheds light on the relationship between Logan and Professor X, and its ending adds an extra note of tragedy to Logan when you think about what's happened in between the two movies.
So, really, at an absolute minimum, you could get away with just X-Men and X-2, but watching The Wolverine and Days of Future Past will provide useful context for Logan's character and relationships, and X-3 is necessary to follow the plot of The Wolverine.
As for the other movies:
X-Men Origins: Wolverine can be skipped. It has some nice contextualizing information about Wolverine's past, though it's a pretty terrible film overall. (Watch it if you want to understand some of the Easter eggs in Deadpool, though.)
First Class can be skipped. It has the least Wolverine content of any X-Men movie. It's a good movie, one of my favorites of the series, but not vital to seeing Logan.
I haven't seen X-Men: Apocalypse, but per Kutulu Mike's comment, the post credit scene is a direct lead-in to Logan. You can skip or watch at your discretion.