Gohar played a crucial role in the closing weeks of the 2021 LV= Insurance County Championship season at Gloucestershire, achieving an impressive 20 wickets in four games.
The 26-year-old told the club website: "Playing county cricket this year and making my debut for Gloucestershire was the realisation of an ambition I've had for some time.
"Getting the opportunity to pull on a Gloucestershire shirt and contribute to a winning team was a great start to my career in England and I'm very pleased to be returning for a longer stint next year.
"We have a team capable of challenging anyone and some great momentum from 2021 to build on. I can't wait to get back and hopefully pick up where I left off."
Gloucestershire performance director Steve Snell said: "We're thrilled to have Zafar back on board for next season, he's already proven just how much quality he has.
"It's a real bonus that Zafar is available for selection right from day one, he provides the squad with depth and makes selection even more difficult for our new head coach Dale Benkenstein, which is a positive problem to have."