'Not longer than' is acceptable here, as is 'no longer than'. Actually, if this is part of a contract, it's more likely to be something along the lines of '... when they are outside your flat for a perid not exceeding three (calendar) months' (or, 'ninety days'.)