We are asked to determine the distance that spring will stretch when a given mass is attached to it.
To do that we will use Hook's law:

where:

We will determine the constant of the spring "k" first using the fact that the spring is stretched 0.8 meters when a mass of 3kg hangs from it.
Since the only force acting on the spring is the weight of the object we have:

Where:

Now, we substitute and we get:

Now, we divide both sides by "x":

Now, we plug in the values:

Solving the operations:

Now, we substitute the value of "k":

Now, we solve for "x":

Now, we substitute the value of the weight of the second object:

Solving the operations:

Therefore, the spring will stretch by 3.733 meters.