The husband can divorce while serving his sentence, and there is no clear time limit for divorce. Divorce shall be granted if the relationship between the husband and wife has really broken down and mediation has failed. If one party is sentenced to long-term imprisonment according to law, and the criminal act seriously harms the feelings of the husband and wife, it shall be deemed that the feelings have really broken. Therefore, divorce is allowed as long as the above conditions are met.
[Legal Basis]
In Article 1079 of the Civil Code, if one of the husband and wife requests divorce, the relevant organization may mediate or directly file a divorce lawsuit with the people's court. When hearing divorce cases, the people's courts shall conduct mediation; Divorce shall be granted if the relationship has really broken down and mediation has failed.