The mass, strictly the inertial mass, relates the acceleration of a body to the applied force via Newton's law:
$$ F = ma $$
So if you apply a force of 1 Newton to a mass of 1kg it will accelerate at 1m/s$^2$. This is true whether the object is floating in space or in a gravity field e.g. at the Earth's surface.
The weight is the force a body exerts when it is in a gravitational field. The weight depends on the gravitational field. For example the weight of a 1kg mass at the Earth's surface is 9.81 Newtons, while at the surface of Mars it's about 3.5 Newtons.
This is possibly a bit too much info: if so ignore this last paragraph. Although weight specifically means the force exerted in a gravitational field, Einstein told us that sitting stationary in a gravitational field is equivalent to being accelerated in the absence of gravity. The inertial mass defined using Newton's laws is the same as the gravitational mass defined by the force a body exerts in a gravitational field. So if you take a 1kg mass at the Earth's surface, the weight of 9.81 Newtons it exerts is exactly the same as the force you'd need to accelerate the 1kg mass at 9.81m/s$^2$.