When installing a digital piano, I have the freedom of vertically placing the entire piano at any height I want.
But, I want to know what the ideal (preferred) height is. Is there a standard height?
The exact height of the keyboard off the floor is less important than the distance between the keyboard and your seat. (Most chairs are too low to the ground to be good as a piano stool) I'd agree with @Jeffrey that forearms-parallel-to-the-floor is a good starting point, also that your knees don't get wedged out of the way by the bottom of the keyboard.
One other thing-- in my experience, most students sit too close to the keyboard. (This may have to do with sitting at a desk most of the time, or with sitting at a piano for the first time while small and then gradually growing and not resetting one's idea of a best distance.)
In terms of standard height:
A Steinway large grand piano I believe is 28 1/8" (71,5 cm) high from the floor to the top of the white keys. You could call that a standard.
The hight varies for different makers, and pianos, with over an inch higher and lower than that.
(My Yamaha upright piano is 28 3/8" [72 cm].)
There are rules for good ergonomics and placing the least amount of stress on your body when you play. Google the Alexander Technique for one approach.
Then there are many pianists who never cared about posture. Two examples (coming from rather opposite approaches to piano-playing) are the world-famous acoustic pianists Glenn Gould and Keith Jarret, who threw all the rules out of the window and spent their careers making amazing music played with horribly bad, stressful posture.
In other words, when you get right down to it, there are no rules. Do what feels best for your body.
For best ergonomics, I was always taught that my forearms should be parallel with the floor, with the fingers resting comfortably on top of the piano keys - so, the arms should be a little above the level of the keys, not reaching up or reaching down. I'd adjust the piano so that the correct piano-playing posture (seated on edge of seat, heel on floor to control pedal) is most comfortable.
More detail here: http://www.wellbalancedpianist.com/bpseatingguide.htm
Classic grand and baby grand is 28-29 inches. Period. Answer made!
I measured 30 pianos from eight manufacturers and nearly all were inside this range. This is without wheel stands or any other such things. This is floor to top of white keys when on the standard legs.
I would build your desk for the lower dimension as it is much more comfortable for a tall person to stoop a bit and play low than for a child or small person to scrunch taller and lift their shoulders to play. I have a wide variety of folks who record in our studio and white keys at 28 inches is comfy for most all of them.
We have our keyboards on pull out rack shelves and this works very well. Out of the way when not needed and easy to deploy when we want it.
As a son of a pianist who taught as well as giving performances, I learned that it is the stool that matters for adjusting access to the keyboard, but the original question asks about the key height. This is not yet well-answered, and it does matter, for the simple reason that a piano is not exactly portable, and cannot be adjusted at will like the stool! For installing a keyboard the height is important because it is the one constant reference to the floor by which all other adjustments are themselves referred.
If someone with access to a room full of pianos could measure and quote several specific examples then this question will be properly answered. Another important measurement that should also be taken in each context is the height of the underside of the keybed above the ground below, because no matter how you adjust the stool, a critical and unadjustable distance is the space available for legroom when using the pedals! Some pianos (and especially electronic actions) may have widely varied thickness of keybed from underside to key tops. This detail is more important than the key-to-floor height alone, because there may be nothing you can do to change it, so it governs all the other adjustments to be made, such as stool height and setback from the front edges of the keys.
No specific standard height exists for electric pianos is best because people ce in different sizes! Would you expect Shaq to play at the same piano height as Danny Devito? It depends on how long your legs are—are they comfortable reaching your pedal? If not you need to first adjust your sitting height. This differs person to person, and pedal to pedal (they're also not all the same). After this, adjust your piano height so you're not playing like you're reaching for for the ants or so you're not playing like it's set on top of the refrigerator. I agree parallel is not best because movement should start at shoulder and work it's way to the fingers. Your fingers and forearms will tire if at parallel because you're not using all the muscles you need to use to play.
I don't think that there is a 'standard' height, rather there's a mean/average. For the 'average' stature pianist this is OK (although people are taller now than they were when the 'norm' height range was developed back in 18/19th centuries. And this is why I have an interest in this subject. I'm tall (6'4") and can't get my legs under an 'average' height keybed. I need at least 68cm or ideally 70cm from floor to underside of the keybed. I've been trying to find some oddball upright with this unusual dimension for some time. They do exist, but they're rare.