The maximum level in Hogwarts Legacy is 40 – you won't find yourself hitting this level by the end of the main story unless you decided to hit absolutely everything on your way there. In order to do this, you'll need to make sure to complete the main quest list, as well as a large number of the side quests in the game.