Hartley was born in New York City, the daughter of Mary Ickes "Polly" (née Watson), a manager and saleswoman, and Paul Hembree Hartley, an account executive. Her maternal grandfather was John B. Watson, an American psychologist who established the psychological school of behaviorism. Her brother, Paul Hartley, is a writer, and a research philosopher (The Seventh Tool, The Lover, Paradise). In 1960, Hartley married John Seventa but they divorced two years later. A second marriage to Patrick Boyriven on August 13, 1978 produced two children, Sean (born 1975) and Justine (born 1978). Hartley and Boyriven divorced in 1996 and Hartley married Jerry Sroka in 2005. Hartley is a 1965 graduate of Carnegie Mellon University (at the time, Carnegie Institute of Technology). In her 1990 autobiography Breaking the Silence, written with Anne Commire, Hartley talked about her struggles with psychological problems, pointing directly to Watson’s practical application of his theories as the source of the dysfunction in his family. She has also spoken in public about her experience with bipolar disorder and was a founder of the American Foundation for Suicide Prevention. In 2009, Hartley spoke at a suicide and violence prevention forum about her father's suicide.
Hartley began her career as an eight year old in the White Barn Theater in Westport, Connecticut. In her teens as a stage actress, she was coached and mentored by Eva Le Gallienne. Her film career began with Ride the High Country (1962), a western with actors Randolph Scott and Joel McCrea, and directed by Sam Peckinpah. In 1962, she appeared in an episode of CBS's Gunsmoke as a mountain girl. In 1963 she starred in the leading role in Drums of Africa with Frankie Avalon, Lloyd Bochner and Torin Thatcher, directed by James B. Clark. She was cast in an episode of the Jack Lord adventure/drama series about the rodeo circuit, Stoney Burke. Hartley had a supporting role as Susan Clabon in Alfred Hitchcock's Marnie in 1964. In the 1963–1964 television season, she appeared in an episode of ABC’s drama about college life, Channing and in two episodes of NBC's The Virginian. In 1963, she was cast as the character Hagar in "The Day of the Misfits" of the ABC western series, The Travels of Jaimie McPheeters, starring child actor Kurt Russell in the title role. In 1965, Hartley was cast as a Mormon "hand-cart" pioneer, Jessica Scott, who with her husband searches for their lost boy taken by Indians while they are en route to Utah, in the episode "The Red Shawl" of the syndicated series, Death Valley Days, then hosted by Ronald W. Reagan. The boy was wrapped in the shawl when he went missing.
In 1966, Hartley appeared as Polly Dockery in the series finale, "A Burying for Rosey," of ABC's The Legend of Jesse James. She also made three guest appearances on NBC's Bonanza, one in 1965 (“Right is the Fourth R”), another one in 1968 (“The Survivors”), and the last one in 1970 (“Is There any Man Here?”) and ("The Iron Butterfly"). She worked with Rod Serling and Gene Roddenberry, two creators of television science fiction. In 1963, she appeared in an episode of The Twilight Zone ("The Long Morrow"). She played the character 'Ellie' in episode 118 (1964) of Gunsmoke. She appeared in two episodes of the NBC series Daniel Boone, "Valley of the Sun" in 1968 and as a nun in "An Angel Cried" in 1970. In 1969, she appeared in the penultimate episode of NBC's Star Trek, "All Our Yesterdays," as Zarabeth. She appeared in several science fiction films, Marooned (1969), Earth II (1971), and the pilot for the post-apocalyptic Genesis II (1973), another Roddenberry production. Her later film roles included two Lee Van Cleef westerns, Barquero (1970) and The Magnificent Seven Ride (1972). She also appeared in The Return of Count Yorga (1971), Skyjacked (1972), Improper Channels (1981), O'Hara's Wife (1982) opposite Ed Asner, 1969 (1988), Encino Man (1992), and Novel Romance (2006).
On television, she portrayed Dr. Claire Morton on the prime-time adaption of ABC's Peyton Place. In 1971, Hartley had a guest appearance with Glenn Corbett on the Gunsmoke episode "Phoenix." In 1973 she appeared as divorcee Marilyn Dietz on The Bob Newhart Show, and in Disney's The Mystery in Dracula's Castle. In 1974, she guest-starred in the "Moran's the Man" episode of Paul Sand in Friends and Lovers. She also guest-starred in the "Zero" episode of Emergency!. In 1975, she appeared on McCloud, starring Dennis Weaver, titled "Lady on the Run." In 1976, she played a widow on Little House on the Prairie episode 43, "For My Lady". In 1978, she appeared in the television series Logan’s Run (based on the film of the same name) and in CBS's The Incredible Hulk in two episodes. As Dr. Carolyn Fields, she marries Bill Bixby's character, the alter ego of the Hulk; for her performance, Hartley won an Emmy Award. In 1979, she appeared in an episode of The Rockford Files titled "Paradise Cove" (Season 6, Episode 1, No. 112 in the Series, first aired September 28, 1979) as Althea Morgan, the Court appointed Receiver.
Hartley appeared in an episode of M*A*S*H as Dr. Inga Halverson (Series 7, Episode 17, "Inga"). She also co-starred with Bixby in the 1983 situation comedy Goodnight, Beantown. She appeared in two episodes of the NBC mystery series Columbo, starring Peter Falk as the rumpled detective. One was "Try and Catch Me" with Ruth Gordon, the other "Publish or Perish" with Jack Cassidy. In 1979, she portrayed the Witch in ABC's holiday telefilm The Halloween That Almost Wasn't, a.k.a. The Night Dracula Saved The World. In 1986, she co-starred with Lynn Redgrave in the made for TV movie My Two Loves. In the 1990s, she toured with Elliott Gould and Doug Wert in the revival of the mystery Deathtrap. She has hosted the long-running television documentary series Wild About Animals, an educational program. In 2005 she appeared in the NCIS episode, "SWAK". In 2006, Hartley starred in her own one-woman show, If You Get to Bethlehem, You've Gone Too Far, which ran in Los Angeles. She played Dorothy Spiller, the mother of Courteney Cox's character on Dirt and is featured as Ceptembre Sage Weller in Shhh ..., a spoof based on The Secret. She had a recurring role on Law & Order: Special Victims Unit as Lorna Scarry. In 2014, she returned to the stage as Eleanor of Aquitaine with Ian Buchanan's Henry in the Colony Theater Company production of James Goldman's The Lion in Winter.