Depending on where you are this varies but most states have adopted the federal code of three and a half feet. Make sure that there is also an additional bar every 2 feet additional in length.
The hand rail on a deck should be at a level where the average person can comfortably grip it without leaning or reaching. If the hand rail is too high or low, it's not very practical.