as far as the code goes, no.
in practice, there are a number of factors that might tend to limit that distance.
Many of which can be overcome by design but that involves additional cost. Filters, cable size, motor winding design, and so on. Borehole pumps obviously have to be located at the borehole and that can be some distance from the sub/switch-room where the drives are located. A few hundred metres in some cases. As I recall, the longest run we did was about 300 metres (1,000 feet) but is was only 75kW (100 HP) as I recall.
Then we had one site where the motors were less than 50 metres from the drives. But their windings were standard and not designed for PWM waveforms. Random wound rather than mesh. They started failing about a month after commissioning and had to be rewound. Expensive embarrassment for the motor designers/manufacturers. Four off 760kW pump drives. And a steep learning curve....
Touching on a post in another thread, buck/boost transformers with VSDs.
The pumping station supply was 3,300V. The VSDs were rated for 500V operation so step down input transformers were required. The motors were 690V units so step up output transformers were needed.