There are two things. If she works under a company's sponsorship, she remains independent and should you lose your job and be asked to return home, she may continue to stay here if she wishes. If your wife comes under your sponsorship, she will have to return when you exit Qatar permanently either just before you leave or along with you. The issue of giving NOC is totally under the discretion of the management of a company. Only they can decide on issuing NOC or refusing it.