It's the summer of 1963. Two young men first meet when they find work sheep-herding for the summer on Brokeback Mountain, a fictional picturesque setting in Wyoming. Ennis Del Mar (Heath Ledger) is age 19, engaged to be married in the fall, and aspires to someday running his own ranch (following in the footsteps of his parents, who died in a car crash and left young Ennis and his brother and sister alone to fend for themselves). Jack Twist (Jake Gyllenhaal) is about the same age and dreams of becoming the greatest rodeo cowboy alive. Both feel essentially alone in the world.
While sharing a cowboy's backbreaking work load, facing the toil and troubles of the weather, shortages of food and wild animal attacks, their working friendship eventually develops into something more... Breaking Joe Aguirre's (Randy Quaid) rule that one man must sleep with the sheep and one at the camp, on one night after an evening of heavy boozing and shooting the bull, they end up sharing the only tent, just to avoid freezing. The bitter cold leads to their sleeping spooned. Jack, who of the two seems more wired for attraction to other men, (and more conscious of his leanings,) initiates touching. Ennis, who is engaged to be married, seems truly naive with respect to Jack's intentions as well as his own responses, yet eventually responds to Jack, releasing his own loneliness, fear and pent-up rage into an almost violent physical passion of rough sex between them. Over the next several days, the two increasingly give in to their passion for one another, building a life-long bond. Both men eventually come to acknowledge and understand the irrevocability of their bond, even if they do not both entirely accept it.
When the summer ends, the two men separate and continue with their lives. Ennis marries Alma (Michelle Williams) and she soon gets pregnant and gives birth to two daughters the following year. Jack, by contrast, is still drawn to other men, and remains unmarried until he meets and after a drunken one night stand, has a son with feisty rodeo cowgirl Lureen Newsome (Anne Hathaway). Lureen's father owns a bona fide money-making business selling farming machinery in Texas, but Jack is never accepted by Lureen's family. Searching for acceptance, approval, and unconditional love, Jack writes to Ennis. It is revealed here that the year is 1967. It has been four years since they met. They arrange to meet again.
When they finally do secretly reunite in Wyoming, Ennis and Jack are overcome with emotion and passionately kiss. Ennis makes a weak attempt to be discreet, but the kiss is seen by Alma, who becomes sickened by it. One can't help but feel sorry for the two men and for Alma as well. From this point on Ennis and Jack's relationship rebuilds and develops even more deeply.
Alma becomes increasingly suspicious about the men's frequent "fishing trips" up to Brokeback Mountain and eventually Alma and Ennis divorce in November 1975, with Alma getting custody of their two daughters Alma Jr. and Jenny.
Jack shows up in Wyoming as soon as he hears the divorce is final, hoping to now be able to live a life ranching with Ennis. Ennis is torn, as he too longs for the idyllic life Jack describes, but he explains that if they live together they will be killed by the locals for being "queer." This leads to an arrangement whereby Jack drives from Texas to Wyoming to meet with Ennis three or four times a year, each meeting leading to another emotional departure.
By 1978, Ennis is desperately struggling to make ends meet and pay child support to his ex-wife, and becoming briefly involved with a pretty waitress named Cassie Cartwright (Linda Cardellini). As a result, Ennis meets with Jack less frequently. Jack visits Mexico looking to satisfy his physical needs in seedy underground gay bars and clubs. When Jack taunts Ennis with this information in an effort to make him jealous, he ends his rant by saying "I wish I could quit you!"
In 1980, Ennis gets a postcard he sent Jack returned with "deceased" marked across it. Jack is dead. When Ennis contacts Jack's wife, Lureen, she lies about Jack's death, telling Ennis he was accidentally killed by a tire iron while changing a flat, when in fact Jack was killed by a homophobic mob for being "queer," just as Ennis had said they would be. She also tells Ennis that Jack wanted his ashes spread at his favourite place, Brokeback Mountain.
Ennis goes to visit Jack's childhood home, where Jack's father (Peter McRobbie) insists that Jack's ashes will be placed in the family burial plot. At Jack's mother's (Roberta Maxwell) invitation, Ennis visits Jack's room and sees two shirts, his and one of Jack's, worn by the two young men in the summer of 1963, and smeared with their blood from a fight. The shirts hang together on the same hanger, tenderly folded into one another, Jack's denim jacket with Ennis's shirt inside - united in perpetuity. Ennis takes the shirts when he leaves.
Ennis moves out of town into a small trailer... alone. The place is low, bare and poorly furnished. Ennis now has nothing and no one. Jumping forward to 1983, a visit from his 19-year-old eldest daughter Alma Jr. (Kate Mara) brings happy news and a sense of hope, as she is to be married. Ennis wants only to know if her boyfriend "really" loves her. She says he does, invites Ennis to the wedding and leaves. Ennis sits, beaten down by years of hard work and alcohol - weathered, aged, and heartbroken. With him... his and Jack's shirts, still entwined, now reversed, Ennis' shirt over Jack's jacket, and a postcard with a picture of Brokeback Mountain.