If it is not directly above (i.e., in the "footprint" of) the panel, then there is no rule about how far it must be. However, if it is above the required working space (i.e., 30 inches wide and 3-4 feet deep) in front of the panel, then it has to be at least 6.5 feet above the floor. A tall person must be able to stand in front of the panel, without bumping their head against anything. Reference: 110.26(E).