I have to kind of fudge this entry because I can't find anything for X. I checked Xanadu and a movie I liked, X (Night of Vengeance) but neither of those was based on a novel. But Days of Future Past has sort of been published as a book, so that seems close enough.
The thing is, when the movie was coming out I bought the "book" from Amazon. It was a ripoff because it's 184 pages but the actual Days of Future Past story is two comics that might be 50 pages. So you have another 135 pages of filler. Seriously, the other stuff didn't have much to do with it except taking place around the same period of time. And they put those two issues in the middle of the book too so it's harder to just read those and put it down.
The movie is of course pretty different from those two comic books. The biggest difference is Wolverine's involvement. In the early 80s when the comics were written, Wolverine was not the god-like character he became by the first movie in 2000. In the second issue he gets zapped by a Sentinel in the future and that's it for him. Whereas by the time they were writing the movie version, Wolverine had all these powers and was most everyone's favorite character. So while in the comics it's Kitty Pryde who travels in time, in the movie it has to be Wolverine.
The target of the assassination is different too. In the comic book it's Senator Kelly, but he died in the first movie back in 2000 so I guess they thought that would be lame. Instead they have to stop a delegation in Paris from being killed and then Nixon. (Though if it was 1973 they would pretty much have been doing Nixon a favor by killing him.) And since Jennifer Lawrence was playing Mystique, she gets a meatier role in the movie.
Anyway, as I said the comics were just two issues and that was it, though I guess the cover design of the one lingered on for a long time and has been parodied a bunch of times, even by a book Tony Laplume co-authored! I'm not sure why they didn't use that for the movie poster, except that they were trying to minimize Kitty Pryde's involvement, especially in "the Rogue Cut" where I guess Rogue has to take her powers to finish the mission or whatever.
It should be obvious that the movie and comics are two completely different animals. I can't really recommend buying the book unless you just get those two issues. Otherwise it's a lot of padding.