In X-Men Origins, Wolverine is called Jimmy. Then he is called Logan? Is this because he lives forever and has to change to hide his mutation? My question here is that where does the X-Men story explain this name change?
Well, it's complicated.
Historically, Wolverine's origins were unknown including why he went by the name Logan.
However, this was explained, kind of, in the comic book series Wolverine: Origins,
Since the character's creation in the '70s, he knew little about his past, and went by the name "Logan" — no last name — when he wasn't using his codename Wolverine. But this series finally revealed the character's past, including his birth name of James Howlett.
In that story, James Howlett is born in the 1880s in Canada to John and Elizabeth Howlett. However, he eventually learns that his real father was a man named Thomas Logan, who kills John Howlett. Young James's powers manifest upon seeing his dead father, and he kills Thomas with his claws. He flees to the countryside after committing his crime, and starts going by the name "Logan." That's the name that sticks with him after he loses his memory after participating in the Weapon X program.
The story of James Howlett's childhood is actually canon in the X-Men movies, too, though I'd forgive you if you forgot about it. It's depicted in the 2009 film X-Men Origins: Wolverine, which was at least in part based upon the 2001 comic. While most of that movie is no longer considered canon thanks to subsequent movie retcons (see: Deadpool), it seems that Logan's backstory as James Howlett remains intact even in the new film.