Time period of oscillation is given by T=2πkm, where k is the force constant of the spring.
∵ Spring is same, therefore, spring constant will be same.
Putting the different values,
In the first case T=1=2πkm
In the second case T′=2=2πkm+3
Dividing the equations, we get
T′T=21=m+3m
⇒m+3m=41⇒4m=m+3⇒m=1
Thus, m=1kg