"Broke it off" has two meanings. It can mean to end a relationship with, and it can also mean to become physically separate. The person in this joke has a boyfriend with a wooden leg. If the person has a wooden leg, that means their real leg became detached at one point. "Broke it off" can refer to what happend to the leg, as in, she broke off her boyfriend's leg. "Broke it off" can also be directed at the relationship, as in, she ended the relationship with her boyfriend. The joke is centered around "broke it off" and how it could refer to two different things. 
She had a boyfriend with a wooden leg , but broke it off .