The 40-year-old actor will star as Patrick Melrose, an aristocratic playboy with a troubled past.
St Aubyn penned five books based on his own life growing up in a highly dysfunctional upper-class family.
The author was abused as a child by his father and went on to struggle with a heroin addiction in his twenties before becoming a writer.
Each episode will follow one of the books, which form The Patrick Melrose set.
David Nicholls, who is writing the adaptation, described Cumberbatch as “the perfect Patrick Melrose”.
“We have been huge fans of these books for many years and David Nicholls’ adaptations are extraordinary,” said Cumberbatch and producer Adam Ackland.
Shooting is set to begin in August in New York, London and the South of France.
Cumberbatch is very busy at the moment as he is also set to star in a BBC adaptation of Ian McEwan’s The Child In Time.
The Imitation Game star’s schedule means it could be a long time before viewers see him in Sherlock again.
Last week, creator Steven Moffat even suggested there would be no season five of the hit detective show.
“It’s not like we haven’t had our reward for doing that show, it’s been such a phenomenon,” he told Broadcast Now. “Not doing it again would be fine. If that was it, then that would be it. None of us will starve in the street – well, I might.”