When NBC televises next year’s Winter Olympics from Pyeongchang, South Korea, a familiar face will be gone from the prime-time anchor seat: Bob Costas, who held the job for 24 years, will be replaced by Mike Tirico, who joined the network last May.

“It just felt to me like the right time and it’s felt like the right time for a while,” Mr. Costas said in an interview this week, in advance of NBC’s scheduled announcement on “Today” on Thursday.

“This was a good time to step away, while I could still do it,” he said.

Mr. Tirico worked at ESPN for 25 years, and his versatility as a host and play-by-play announcer made him a leading contender to succeed Mr. Costas as soon as NBC hired him. He was a daytime host during the Summer Olympics in Rio de Janeiro last year. He has also called National Football League and Notre Dame games and has hosted the United States Open golf championship.

“I knew Bob wasn’t going to stay in the job for 20 more years,” Mr. Tirico said in an interview, “but I didn’t know if they were going to choose me or when it would happen.”

Mr. Costas’s long run as the prime-time host calls to mind that of Jim McKay, who covered or hosted 10 Olympics for ABC Sports. That Mr. Costas held the job for so long reflected NBC’s commitment to making the Olympics the centerpiece of its sports portfolio and to holding onto highly rated programming that appealed to a broad demographic, especially women. The network has spent billions of dollars to carry every Summer Games since 1988 and every Winter Games since 2002.

NBCUniversal, the network’s parent company, has the rights to carry every Olympics until 2032.

Mr. Costas was NBC’s late-night host during the 1988 Summer Games in Seoul, South Korea, when Bryant Gumbel was the prime-time host. Mr. Costas took over the prime-time assignment in 1992, when the Summer Olympics were in Barcelona, Spain. The only gaps in his prime-time hosting résumé came when CBS televised the 1992, 1994 and 1998 Winter Games.

“The 11 prime-time Olympics may never be touched,” said Mr. Tirico, 50, who declined to discuss the streak he might have if he kept the prime-time position through 2032.

“Hopefully they invite me back for another,” he said. “I’m just focused on South Korea.”

Mr. Costas, 64, decided before the Rio Games that it would be his final Olympics as the prime-time host.

“Rio had some capstone moments,” he said. “Michael Phelps was finishing off. So was Usain Bolt. And Simone Biles was emerging. It had moments that felt like closure to me, and this felt like a good time to step aside.”

He said that in his 24 years, the job of hosting the Olympics had changed. The increased number of events and the need to keep viewers engaged with the action had reduced his time for conducting interviews and delivering essays.

“I wasn’t getting bored by it, but over time the formats changed a bit,” he said. “At the beginning it was more freewheeling and there were more spaces for me to contribute. And it became more tightly formatted as the years went by.”

The Rio Games served as a salve to his experience two years earlier at the Winter Olympics in Sochi, Russia, where viral conjunctivitis in his eyes kept him off the air (and largely in a dark room) for six days, with Matt Lauer and Meredith Vieira filling in.

“If that had been my last Olympics, I would have wanted to do one more,” he said. His contract allowed him to determine whether he continued in the job, and he said he would have stayed if NBC had not had someone like Mr. Tirico in place.

Mr. Costas is not only leaving as NBC’s prime-time host, he is also reducing his overall workload at the network. He will no longer host “Football Night in America,” the pregame show that airs before the network’s “Sunday Night Football” broadcasts. He will host the Triple Crown horse races this year but in the future, he will be only at the Kentucky Derby unless a horse is vying for the Triple Crown at the Belmont Stakes. In that case, he would host the Belmont race. He will host next year’s Super Bowl coverage while Mr. Tirico is in Korea.

Mr. Costas will take on a role at the network similar to Tom Brokaw’s, offering commentary and features at major events, like the Olympics or the Super Bowl, or appearing on NBC programming when news breaks, as he did when Muhammad Ali died last year. The network regularly calls on Mr. Brokaw, the former NBC “Nightly News” anchor, to comment on major events like presidential elections.

Scaling back his NBC schedule will give Mr. Costas more time to indulge his love of baseball at MLB Network, where he calls games, narrates documentaries and hosts round-table shows.

His decision to change his role at NBC comes as other major sportscasters have cut back or moved on. Brent Musburger left ESPN to create, with his family, an online network devoted to sports betting information. Verne Lundquist will no longer call Southeastern Conference football games at CBS. And Chris Berman is taking on a reduced role at ESPN.

Mr. Costas is prepared for his change and is also fond of recalling when everything he wanted to do was at NBC: He called baseball games, hosted the talk show “Later,” contributed to NBC news magazine shows, hosted N.B.A. and N.F.L. programs and called basketball games.

“And,” he said, “I was younger then.”