Viertel was born to Jewish parents in Dresden, the writer and actress Salka Viertel and the writer Berthold Viertel. In 1928, his parents moved to Santa Monica, California, where Viertel grew up with his brothers, Hans and Thomas. The home in Santa Monica Canyon was the site of salons and meetings of the Hollywood intelligentsia and the émigré community of European intellectuals, particularly at the Sunday night tea parties given by Viertel's mother. However, Viertel identified more with Southern California youth culture than with the European millieu he was exposed to by his family. "The physical aspect of European intellectuals was so totally different from what an American kid wants to be," he told the International Herald Tribune in 1992. "I knew Bert Brecht was close to being a genius, but he was a funny-looking man to me."
Viertel graduated from Dartmouth College in 1941. He was an enlisted man in the United States Marine Corps in the South Pacific theater for part of World War II, but after being assigned office work in California (in his memoirs he joked he was a "Remington Raider" in reference to the typewriters they used), he sought and eventually gained work with the O.S.S. as a second lieutenant. His native German language skills were put to use in Nazi-controlled Europe. Viertel later co-wrote a play titled The Survivors with writer Irwin Shaw based upon experiences related to World War II.
Viertel was best known for his novel White Hunter Black Heart, which was made into a film starring Clint Eastwood in 1990. It is a thinly-disguised account of Viertel's experiences working with film director John Huston while they were making The African Queen. The central character is scriptwriter Pete Verrill while the Huston character is called John Wilson. Viertel's opinion of the finished film was tempered by his idea that Huston himself would have preferred a portrayal with more sarcasm. Viertel's looks and personality were an inspiration for Robert Redford's character Hubbell Gardiner in The Way We Were.
Of his screenwriting work for Hollywood productions, Viertel said that it was primarily a vehicle for income so that he could continue to write novels. Though he worked closely with movie professionals that he liked such as Billy Wilder and Huston, Viertel said there was always creative tension.
Viertel is recognized for introducing surfing in Europe. In 1956, while on location in Biarritz for the filming of The Sun Also Rises, Viertel was so impressed by the waves that he sent for his surfboard from California and soon afterwards started Europe's first surf club.
Viertel was twice married. His first wife was Virginia Ray "Jigee" Schulberg, the ex-wife of the novelist and screenwriter Budd Schulberg; she was pregnant with their only child, Christine, when Viertel abandoned her to live with the fashion model Simone Micheline "Bettina" Bodin. Varying sources show that Viertel and Jigee divorced in 1958, 1959, or were still separated but legally married upon her death in January 1960. Bettina left him for Prince Aly Khan in 1955, and was pregnant with Khan's child when he died in May 1960. Viertel's second wife was the actress Deborah Kerr, marrying her on 23 July 1960. Viertel was widowed by Kerr on 16 October 2007, just 19 days before he died from lymphoma while living in Marbella, Spain; he was 12 days shy of his 87th birthday. Through Kerr he had two stepdaughters, Melanie and Francesca Bartley.
At the time of his death, it was reported that a novel based upon his O.S.S. experiences from World War II was in completed form, as was also a second volume of memoirs.
A filmed documentary by director Michael Scheingraber was in production at the time of Viertel's death. Titled Peter Viertel – Between the Lines, the film is based upon over 400 minutes of recorded interviews with him.