..expiry date of your RP Visa or your Qatari ID card
is corresponding to your entry date into Qatar...

Work Visa issued for you may be for a duration of 1 or 2 or 5 years.

You can still continue to work / live in Qatar for less than equal to 3 months from the expiry date of your Qatar ID / RP Visa and get rid of yourself with a Exit Permit and not return OR cancel your RP or leave Qatar within 7 days.

Hope this helps....LOL !!