Did you do all the quests on the ship? You should be able to leave once the story part and quests are done.