I've been looking for further information related to this difference. Considering the definitions of length, after some research I finally thought about this logical idea (as English is not my mother tongue, please correct me if I'm mistaken at any point):
In a dictionary I got these 2 definitions about length:
a) Continuance in time; "the ceremony was of short duration"; "he
complained about the length of time required".
b) Size of the gap between two places; "the distance from New York to
Chicago"; "he determined the length of the shortest line segment
joining the two points".
1a. is related to duration,
1b. is related to distance.
Considering that we use "how long" for length OR time and "how far" for distance, then, according to the definition of length, we can also use "how far" for length, am I correct?
It seems to me that when talking about length we can use both "How long" or "How far", it depends on what the context gives us (length related to duration or distance).
In addition, besides the explanation of 'duration' related to "how long", I found this definition about the word "long": "Extending or traveling a relatively great distance."
Finally, according to this example I found in a English textbook:
"How long is the Panama Canal? - About fifty miles from the Atlantic
to the Pacific."
we can use "how long" for questioning distance also (when talking about lengths and measures).
how far - a) distance and b) length (miles, kilometre, feet, etc.).
how long - a) duration and b) length (measure and time).