there is not "the answer" to the question you posed. The length and the diameter of the capillary tube affect the mass flow rate through it. The mass flow rate depends not only on geometry but also on the thermodynamic prop of the refrigerant and the operating conditions: pressure and subcooling at the capillary tube inlet (pressure at the evaporator is important if the flow inside the capillary tube is not choked).
Once you design a heat pump or a refrigerator with a capillary tube, the inlet/outlet conditions at each component (compressor, condenser, evaporator and capillary tube) will depend on the sizing of each component itself and on the actual buondary conditions (temperature, flow rates of the fluids at the evaporator and condenser). So the balancing of the system will affect the inlet conditions to each components and the real conditions could be far from the nominal ones.
For this reason, usually, the procedure used inside the R&D labs for thermodynamic design, have some preliminary calculations of the diameter/length based on correlations available in literature at the nominal conditions of the system. Then simulations and tests in further conditions are required to check that, in the whole range of application of the system, the refrigerant at the exit of the compressor is feed by superheated refrigerant to prevent risks for its durability. Also the refrigerant charge has to be appropriately choosen depending on the refrigerant, the operating conditions and the volume of the system, otherwhise the capillary tube will not be correctly feed by a liquid at the inlet, with unstable working conditions for the system.
Taking into account for all these considerations, and also :
-for the fact that the equations for the sizing of the capillary tube have a poor accuracy ;
-for the fact that the diameter of such tubes is small (less than 1.8 mm usually) and of a size not so reliable,
the labs use a try-and-error approach following some procedures reccommended by standard. The ASHRAE handbook (part Refrigeration) reports such procedure.
The use of appropriate softwares could help to reduce the experiments in the labs.
Please account that based on researches from our labs the couple diameter/lenght of capillary tube, with the refrigerant charge and the size of the compressor will affect notably the performance of a heat pump or a refrigerator.