Castro, 29, becomes the third Dortmund midfielder to commit his future to the club in recent months, after rising stars Julian Weigl and Christian Pulisic signed long-term deals in December and January respectively.
"I'm delighted with the faith the club have shown me," Castro enthused. "I can honestly say that I'm proud to wear the black-and-yellow shirt, and to play football in front of such magnificent fans."
Castro joined Dortmund in July 2015 from boyhood club Bayer Leverkusen, where he spent a total of 16 years – 11 as a professional.
"In his short time here, Gonzo has become an invaluable member of the team both on and off the pitch," added BVB sporting director Michael Zorc.
Castro has made 72 appearances in all competitions for Dortmund – including 31 so far this season – notching up 10 goals and 18 assists.