This is one of the hardest things to rig. There are a few ways to handle the coil stretching. One which @FedPete mentioned is to change the coil to a curve. Another is to create a bone chain along the coil using using Spline IK. If you’re animating in blender you can use a driver and shapekey method to handle the stretching. There is also the telescoping method. You can also do a simple scale along the coil.
So let’s start with the first part of rigging this. The deformation(DEF) bones. You need one for the Arm, One for the base(the piece the spring bottom attaches to), one for the bottom hook of the spring, one for the coil of the spring, and one for the top of the spring. Note: For this post I’m just going with the simple scale along the coil. The head to tail for the spring is important. Spring bottom’s tail should move towards the spring coil. Spring coil should point towards the spring top. Spring top should be flipped. with head at the top of the top and the tail at the Spring coil.
Next would be a couple of mechanism(MCH) bones to prevent cyclic reduncy problems(AKA Parent or Constraint loops). Just duplicate the top spring and bottom sprint bones. Some people scalle them down. Just make sure to scale on individual origins. you want the the head of these bones to not move. You could also add an additional bone at the springs top for parenting to, but I’d just the arm unless you plan on animationg the spring removed from the arm.
Next is parenting. Spring top and top MCH is parented to arm(Unless you added an extra bone in which case they are parented to that bone.) Spring coil is connected parented to spring bottom. bottom MCH is parented to spring bottom. Spring bottom is parented to base.
Next the constraints which needs to be done in pose mode. First getting them to face each other Spring bottom is given a damp track with top MCH as it’s target. Top spring is given Damp track with Bottom MCH as it’s target. Second the stretching. Give spring coil the stretch to constraint targeting the Top spring and set head/tail to 1 so that it stretches to the tail of the top spring bone. If you added the extra parent bone then add a child of constraint to it setting target as the arm bone. You may also want to add a limit distance with spring bottom as it’s target so that you can limit the max stretching.
The last part would be any control bones and constraints you want to add. In this case the arm and the extra parent.