Usually, 30 minutes before the flight is enough, for immigration and to check that everything is in order.