You can extend it. If your wife is here in Visit Visa [initially given for 1 month], you can get it extended up to a maximum of 6 months by paying QAR 200/- per month. You can get the extension done at Immigration office, Al Gharaffa in the afternoon session also. It is not necessary to approach them in the morning itself.

If you wish to apply for a residence visa, then you have to do necessary paperwork and submit it at the Ministry of Labor. For more details, send me a message.