"Anna Karenina," directed by Joe Wright, will star Knightley in the title role with Law as her husband, Aleksei Karenin. Aaron Johnson has also signed on to play Count Vronsky.
Other members in the cast are Kelly Macdonald, Matthew Macfadyen, Domhnall Gleeson, Alicia Vikander, Emily Watson, Olivia Williams and Ruth Wilson.
The film's creative team includes composer Dario Marianelli, costume designer Jacqueline Durran, production designer Sarah Greenwood and cinematographer Philippe Rousselot.
Stoppard is a four-time Tony Award winner for his plays The Coast of Utopia, The Real Thing, Travesties and Rosencrantz and Guildenstern Are Dead. His works for the stage also include Rock 'n' Roll, The Invention of Love, Jumpers, Artist Descending a Staircase and Night and Day.
Law was nominated for a Tony Award in 1995 for his performance in Indiscretions and again in 2010 for Hamlet. Knightley has appeared on the West End stage in The Children's Hour and The Misanthrope.
Tim Bevan will produce the film for Working Title Pictures. "Anna Karenina" will be distributed by Focus Features in the U.S. and Universal Pictures International worldwide in late 2012.