Bisping (30-8) has agreed to face Gastelum in the main event of UFC Fight Night on Nov. 25 in Shanghai.
Gastelum (13-3) was originally scheduled to face Anderson Silva, but Silva was removed from the card this week because of a potential doping violation.
It's a very quick turnaround for Bisping, 38, who suffered a submission loss to Georges St-Pierre at UFC 217 last weekend in New York. Bisping had broached the subject of a potential retirement before the fight, but later made it clear he intended to fight again.
Bisping, who fights out of Southern California, is no stranger to short-notice fights. He won the UFC middleweight championship in 2016 in a short-notice fight against Luke Rockhold.
For Gastelum, it's the second time a scheduled fight against Silva has fallen through. They were supposed to fight at UFC 212 this summer, but Gastelum was pulled after testing positive for marijuana.