Richards, who will become a free agent at the end of the season, is 5-4 with a 3.66 ERA. He was given the option of undergoing the surgery or taking a non-surgical approach and had been weighing the decision overnight.
"It sucks," Richards told reporters. "I wanted to be back out there and compete. I wanted to be there for my teammates. ... This is something that I have to do.
"Just get the surgery, move forward and get back for the second half of my career, hopefully."
This is the third consecutive season Richards has dealt with an arm injury.
The right-hander had been limited to six starts each of the past two seasons. He missed most of 2016 due to a UCL injury and suffered from biceps nerve irritation last year.
In 2016, he opted not to have surgery for the UCL issue, opting instead for stem-cell and platelet-rich plasma treatment.
"I don't regret it whatsoever," Richards said. "I was able to come back. To be honest with you, the ball was coming out of my hand great. I don't think anybody will dispute that."
Richards, 30, had made 16 starts this season, his most since 2015. He made his second start Tuesday since returning from the 10-day disabled list because of a left hamstring strain.
He gave up three runs on four hits over 2⅔ innings and left the game in the middle of an at-bat in the third inning against Seattle's Nelson Cruz.
"A lot of guys come back from this surgery and they have long careers," Richards said. "Hopefully, this adds a few years on the end of my career.
"I'll be back. Everything will be fine. I'll get through this. I'm going to be positive about this. I'm not going to dwell on the negative stuff. This is what was presented to me, and this is what I've got to deal with."
The Associated Press contributed to this report.