Step 1: Apply conservation of mechanical energy.
Let the radius of the earth be
\[
R.
\]
Escape velocity is
\[
v_e=\sqrt{\frac{2GM}{R}}.
\]
Given,
\[
u=\frac23v_e.
\]
Hence,
\[
u^2
=
\frac49v_e^2
=
\frac49\left(\frac{2GM}{R}\right)
=
\frac{8GM}{9R}.
\]
Initially,
\[
E_i
=
\frac12mu^2-\frac{GMm}{R}.
\]
At the maximum height,
\[
E_f
=
-\frac{GMm}{R+h}.
\]
Since energy is conserved,
\[
\frac12mu^2-\frac{GMm}{R}
=
-\frac{GMm}{R+h}.
\]
Step 2: Substitute the given velocity.
Substituting
\[
u^2=\frac{8GM}{9R},
\]
we get
\[
\frac12m\cdot\frac{8GM}{9R}
-\frac{GMm}{R}
=
-\frac{GMm}{R+h}.
\]
Therefore,
\[
\frac{4}{9}-1
=
-\frac{R}{R+h},
\]
or
\[
-\frac59
=
-\frac{R}{R+h}.
\]
Hence,
\[
R+h=\frac95R.
\]
Thus,
\[
h=\frac45R.
\]
Step 3: Calculate the maximum height.
Since
\[
R=6400\text{ km},
\]
\[
h
=
\frac45\times6400
=
5120\text{ km}.
\]
Hence,
\[
\boxed{5120\text{ km}}.
\]
Thus,
\[
\boxed{(B)}
\]
is the correct answer.