There are many differences between Homer's Iliad and the 2004 movie Troy, starring Brad Pitt as Achilles. One, in particular, is the duration of the war. For cinematic purposes, all the key moments are compacted into a short time (just under three weeks) to create a sensational adventure. It's important to note that the siege of ancient Troy lasted ten years. When the wooden horse arrived at the gates of Troy, for instance, Achilles was already killed, so the timeline of events is skewed in the film.
Other examples of differences include the relationship between Achilles and Patroclus, played by the actor Garrett Hedlund. In Troy, Patroclus is referred to as a cousin. In the Iliad, however, Patroclus was Achilles close comrade, perhaps even his lover, and someone he would've fought to protect and ensure his safety.
The details are a little different between the book and film on how exactly Patroclus was killed. In the Iliad, the god Apollo intervenes during a battle and removes Patroclus's ability to fight skillfully; Euphorbos then hits him with a spear. After, Hector steps in and kills Patroclus by stabbing him in the stomach with another spear. In the film, however, Hector euthanized him. True to the book, Achilles's grief fuels his revenge on Hector in the film.
Lastly, it's important to note that the end of the film was not from the Iliad, which ends with Hector's death. Instead, the filmmakers took some liberties and used Homer's other book, The Odyssey, to recreate a new ending that delivers the victory and sack of Troy.