Align roll relative to the axis defined by the bone and its parent. X, Z. Global Axis. Align roll to global X, Y, Z axis. X, Y, Z. Active Bone. Follow the rotation of the active bone. View Axis. Set the roll to align with the viewport. Cursor. Set the roll towards the 3D cursor. Flip Axis. Reverse the axis direction. Shortest Rotation
Properties - Parenting — Blender Manual
Select the vertices in Edit mode, remove them from all vertex groups named like a bone, and add them to this one group that has the same name as the bone you want to parent the vertices to.
Blender creates a vertex group for each bone if you parent the armature With Automatic Weights, With Empty Groups or With Envelope Weights. The weight assigned to the vertices in the group controls the influence of the bone on the mesh.
If you move the hips and the arm moves as well then you need to remove the arm vertices from the hips vertex group. You can do this visually in Weight Paint mode (paint with WP=0), or in Edit mode with plain numbers by editing the values in the N-panel (Item > Vertex Weights) or assigning/removing vertices from the group (Object Properties > Vertex Groups).
If you remove the weight of the hip bone from the arm you should add it to the arm bone (keyword normalize weights).
The bones in an armature are almost like separate objects. If a bone is not connected to its parent bone or restricted in some way you can move it freely as you have shown.
When a bone is parented, there is an option to have it connected, when enabled, this prevents a bone from being moved out on its own, effectively only allowing rotation. With it disabled, you often only want to rotate the bone, instead of moving it. This also prevents a bone being positioned away from the parent bone as the legs are in your armature.

The simple way to prevent the movement you show is to enable the transform locks.

Constraints can also be used in some situations to control bone movements.
In your example armature, you could also add a hip bone that it connected to the spine and the leg, preventing the movement you show.
This issue have been solved by cleaning the parent of the target bone, wich was the stretching bone itself. This chain of parenting is not the correct usage of armature bones and constraints.
These bones are probably part of 2 different armatures. If for some reason you really want to parent a bone of an armature to a bone of another armature you can use a Child Of bone constraint:
