It should take around 30-35 hours to beat Hogwarts Legacy if you focus primarily on the story. As it is an open-world game, filled with exploration and side quests, you could be playing it for a lot longer than that.