Typically the very top of the standpipe (the end-cap) would be pretty close to the height of the aquarium. It does not need to be exact, I would recommend a little taller over too short. When viewed from the side you should expect the standpipe to be about 1/2 inch (13mm) higher than the plastic rim of the tank.
When ordering a standpipe it would be the measurement from the glass bottom of the tank to the very top outer plastic rim of the display, rounded up to the nearest inch.
It can be lower than the rim if needed, for example in cases where a glass lid is used over the aquarium. Keep in mind that the shorter the standpipe, the greater the difference in water level between the aquarium and the overflow chamber. The increased difference can lead to a splashing noise as water enters the overflow chamber.