Before your company cancels your visa, they will ask you to get your wife's visa cancelled first without which your visa cannot be cancelled. If your sponsor gives you NOC, your wife can stay with you until the time you wish to leave Qatar. Please keep in mind that once the visa gets cancelled, one must leave within seven days or there is a penalty of QR 200 for each extra day of stay.