I want to make sure that my length distance constraint is equal to my rod length rating.

Example: My stem measures 5 inches so my distance constraint would be 5 inches but if I change my stem length to 3 inches my distance changes to 3 inches too, automatically.

How to do?

Building on Vladimir's approach, I think this is what you want. Please note that due to the way we construct the limit distance mates, the drag behaviour can get a bit 'sticky' at the ends of the limit, especially if you're trying to drag quickly.

If you choose to use this approach, please note that both limits need to have maximum values greater or equal to the maximum length you'll ever set your cylinder to, or there will be solve failures.