They're both correct. The difference is that the second is asking for a more precise figure, and so it sounds more formal/scientific/academic. Because of this, the second might not sound so natural in casual contexts.
For example, if you're chatting with a friend about a river that you've visited, your friend would probably ask "How long is the river?", and you could give an approximate answer. "What is the length of the river?" sounds like something out of a geography test, and it would require an exact figure as an answer.
The same goes for other measurements. In everyday situations, you'd say "How tall are you?", whereas "What is your height?" is something that you'd encounter on a form you might fill in for a medical examination.