
Only iPhone 11 or later supports hands-free call hang-up with Siri.
To turn it on: Settings→Siri & Search→Call Hang-Up
Note: the other person will hear you say "Hey Siri, hang up."
If you have an older iPhone, you'll need to wait for the other person to end the call.