Australia opener Langer resumed on his overnight score of 234 not out but, after more than 10 hours at the crease, was eventually dismissed when he was caught at long-on by Neil Sarkar off former England leg-spinner Ian Salisbury.
In all the 35-year-old left-hander faced 416 balls with two sixes and 43 fours after passing Richards's 322, Somerset's previous highest individual score.
The West Indian set his mark in 1985 against Warwickshire at Taunton.
"For the last few years I've had the target of making a triple century in my diary," said the Australian.
"So the seed's been there for a long time and it feels great now to have achieved it. I'm thrilled by it and I'll look back on it with a great deal of pride."
On Wednesday Langer, in what was set to be his final match in England before returning home, broke the highest ever individual score at Guildford, beating the previous best of 228 recorded by Darren Bicknell in 1995.
"Justin simply continued playing like he did on Wednesday," said Somerset director of cricket Brian Rose.
"He never looked like getting out until he did. It was a tremendous effort of concentration by a player who understands his game perfectly.
"I was there when Sir Viv scored his 322 and remember him murdering their attack. Justin is a different type of batsman. He knows his strengths and the shots he's not so proficient at.
"Those shots he simply doesn't play and he's a wonderful example to our younger players."
Langer was just a boundary away from beating Charlie McCartney's 345 for the Australians against Nottinghamshire at Trent Bridge in 1921, the record score by an Australian in England, when he was dismissed.
Langer's was the tenth highest score in all first-class cricket in England.