My wife was came to Doha on a visit visa before she received her permenant residency. In the airport you can get a visit visa for 3 WEEKS only and you are allowed to extend it for one more week. Then you have to leave Qatar after the fourth week. My wife used to fly to Bahrain for one hour and then come back on the same day to Qatar and get a new visa for a maximum of 4 weeks. My wife had to fly twice to Bahrain before she got her permenant residency