The 28-year-old joined Ulster in 2014 from Super Rugby franchise The Sharks and he has made 42 appearances.
"My wife and I are settled in Belfast and our son was born here, so it is a special place for us," said Herbst.
"I'm looking forward to competing with the guys for the starting number 3 jersey over the next few years."
The South African added: "I truly believe that the squad is really starting to develop, with improving depth across most positions."
Ulster director of rugby Les Kiss believes Herbst will continue to be a key player for the Pro12 team.
"Wiehahn is a great bloke and I'm delighted that he's agreed to stay on with us for another couple of years," he said.
"He is still relatively young for a prop and we fully expect that his best years are still ahead of him. I have no doubt that he will continue to be an important player for us.
"He is very powerful in the set piece and this has been a huge weapon for us since his arrival. His work ethic is first class and he is committed to developing his game, while also ensuring that others are too."
Ulster prop Wiehahn Herbst has signed a two-year contract extension which will keep him at Kingspan Stadium until at least the summer of 2019.