In 2035, Lunar Industries has made a fortune after an oil crisis by building Sarang Station, an automated lunar facility to mine the alternative fuel helium-3 from Moon rocks, rich in the material. The facility is fully automated, requiring only a single human to maintain operations, oversee the harvesters, and launch canisters bound for Earth containing the extracted helium-3. Currently, Sam Bell nears the end of his three-year work contract at Sarang Station. Chronic communication problems have disabled his live feed from Earth and limit him to occasional recorded messages from his wife Tess, who was pregnant with their daughter Eve when he left. His only companion is an artificial intelligence named GERTY, who assists with the base's automation and provides comfort for him.
Two weeks before his return to Earth, Sam suffers from hallucinations of a teenage girl. One such image distracts him while he is out recovering a helium-3 canister from a harvester, causing him to crash his lunar rover into the harvester. Rapidly losing cabin air from the crash, Sam falls unconscious in the rover.
Sam awakes in the base infirmary with no memory of the accident. He overhears GERTY receiving instructions from Lunar Industries to prevent him from leaving the base and to wait for the arrival of a rescue team. His suspicions aroused, he manufactures a fake problem to persuade GERTY to let him outside. He travels to the crashed rover, where he finds his unconscious doppelg채nger. He brings the double back to the base and tends to his injuries. The two Sams start to wonder if one is a clone of the other. After a heated argument and physical altercation, they together coerce GERTY into revealing that they are both clones of the original Sam Bell. GERTY activated the newest clone after the rover crash, and convinced him that he was at the beginning of his three-year contract.
The two Sams search the facility, discovering a secret vault containing hundreds of hibernating clones. They determine that Lunar Industries is unethically using clones of the original Sam Bell to avoid the cost of new astronauts. The elder Sam drives past the interference radius in a second rover and tries to call Tess on Earth. He instead makes contact with Eve, now 15 years old, who says Tess died "some years ago." He hangs up when Eve tells her father (offscreen, identified as "Original Sam" in closed captioning) that someone is calling regarding Tess.
The two Sams realize that the incoming "rescue" team will kill them both if they are found together. The newer Sam suggests sending the other to Earth in one of the helium-3 transports, but the older Sam, with his health declining, knows that he will not live much longer (he has learned that the clones are designed to "break down" at the end of the 3-year contract, their bodies disposed of under the guise of sending them back to Earth). He suggests the younger Sam leave instead. The older Sam plans to die by the crashed rover so Lunar Industries will not suspect anything until it is too late.
The younger clone orders GERTY to revive a seventh clone to greet the rescuers. Following GERTY's advice, the younger Sam reboots GERTY to wipe its records of the events. Before leaving, the younger clone programs a harvester to crash and wreck a jamming antenna, thereby enabling live communications with Earth. The older Sam, back in the crippled rover, remains conscious long enough to watch the launch of the transport carrying the younger Sam to Earth.
The transport arrives at Earth, and over the film's credits, news reports describe how Sam's testimony on Lunar Industries' activities has stirred up an enormous controversy, and the company's unethical practices have plummeted the company's stock.

Question: How long was Sam Bell's contract to work on the moon?
Answer: 3 years