Hang It Up

What does the idiom “hang it up” mean?

Definition: to retire, to end an activity one has pursued for a long time

Example: I’ve always loved bicycling, but now when I do it, it gives me knee problems. It’s time for me to hang it up.