The 32-year-old has been troubled by shoulder injuries since moving to Griffin Park in 2010 and has only made one appearance this season.
"I am retiring because I have peaked and don't have the confidence that I can now surpass that peak," Lee told the Brentford website.
"As a result, football to me now equates to frustration and often pain."
He added: "I do feel blessed to have had so many fantastic memories to take away from the game that will live with me forever."
Lee established himself as Brentford's number one shortly after joining from Watford but fell down the pecking order during the 2012-13 campaign.
In total, he has played 87 games for the west London club.
Meanwhile, fellow keeper Jack Bonham has signed a new three-and-a-half-year deal with the Championship club.
The 21-year-old, who has made three appearances since joining the Bees from Watford in 2013, will remain with them until the summer of 2018.
Brentford goalkeeper Richard Lee has confirmed he will retire from playing at the end of the season.