Paradox An IK constraint by itself cannot specify limits for how far a bone can stretch or compress. However, by combining it with a transform constraint, you can effectively define a range within which that stretching or compression is allowed.
This is possible because, with the Clamp option enabled for the transform constraint, you can set things up so that once the target bone moves outside a certain range, the IK constraint's target bone starts moving together with the constrained bone.
This may be a little difficult to understand from a text explanation alone, so if you can describe the specific case where you would like to use this, I can also create a sample project to demonstrate it.