Foster, a former European 5,000m gold medallist and a Commonwealth champion at 10,000m, began his commentary career in 1980 and has since gone on to cover nine summer Olympic Games for the BBC.
"I have loved every minute of my time working for BBC Sport," said Foster.
It just seems the right time and the right place - at a World Championships in the UK - to say thank you and goodbye
"It has been a privilege and I am very lucky to have done what I have done since my competitive career finished."
The BBC's director of sport Barbara Slater said: "Brendan's knowledge, instinct, tone, timing and skill have been wonderful to listen to, and he has given all of us so many great moments.
"His words and iconic commentaries will be heard for years to come."
Foster, 69, was named BBC Sports Personality Of The Year in 1974 after winning gold over 5,000m at that year's European Championships in Rome, as well as setting a new world record over 3,000m at his home track in Gateshead.
After retiring from the track he became one of the leading voices of the BBC's athletics coverage, taking in every Commonwealth Games since 1982 and every World Athletics Championships since the inaugural event in 1983.
He has also been ever present at the London Marathon since its inception in 1981, with this year's event on 23 April to be his 37th and last.
Foster said: "My very first commentary was shortly after the 1980 Olympics at a cross-country event at Gateshead and that's when I started to work with the greatest sports broadcaster of all time, David Coleman.
"David was just so professional and diligent and he taught me so much. After David retired, Steve Cram took over and working with Crammy for almost 20 years has been so special too.
"We have had so many special days, and those recently with Sir Mo Farah winning golds galore, particularly at the Olympic Games, are commentaries that stick out in the memory as we have witnessed true greatness.
"It's also been an honour to work with so many great people who have been a part of the BBC Athletics team - both in front of and behind the camera."
Media playback is not supported on this device
BBC commentator Brendan Foster is to retire following August's World Athletics Championships in London.