We can solve the problem by using the law of conservation of energy.
When the rocket starts its motion from the Earth surface, its mechanical energy is sum of kinetic energy and gravitational potential energy:

where
m is the rocket's mass

is the rocket initial speed

is the gravitational constant

is the Earth's mass

is the distance of the rocket from the Earth's center (so, it corresponds to the Earth's radius)
The mechanical energy of the rocket when it is very far from the Earth is just kinetic energy (because the gravitational potential at infinite distance from Earth is taken to be zero):

where

is the final speed of the rocket.
By equalizing the initial energy and the final energy, we can find the final velocity:

Do you know what's this unit called? it may help figure out how to do it.
El kilogramo de fuerza, o kilopond, es una unidad de fuerza métrica gravitacional. Es igual a la magnitud de la fuerza ejercida sobre un kilogramo de masa en un campo gravitatorio de 9.80665 m / s².
Conservation of energy explains that energy can only be transferred between different forms of energy