3-4 days should be good enough
1 day - You will take one day approx. at jaisalmer fort as it is a very big fort to enjoy fully
1 day - You will need to travel within the city to see its famous landmarks at ease
1 day - to go to Longewala post tour
1 day - Sand dune bashing if you interested
you could add one more day just to sit and relax and enjoy