How are the combustion chamber length and diameter decided?
Are there any proper formulations or procedures?
You can referthis book Modern Engineering for Design of Liquid-Propellant Rocket Engines chapter 4.
It depends the on the number of performance parameters such as $C_f, C^*$ and $I_{sp}$. From which the Throat area is calculated.
Throat area is usually used as a starting point to have the thrust chamber dimensions. Characteristic length and Contraction ratio are the important parameters to have the length and diameter of the chamber.
You can get the contraction ratio for given propellants and throat area from the plot in the book. Chapter 4. Fig 4-9(Refer book Pg 73). Also, a range of characteristic length for different propellants are given in the table 4-1(Refer book Pg 72).
$L^* = \frac{Vc}{At} = \frac{W_{tc} v t_s}{A_t}$
where $V_c$ = chamber volume, $ft$;
$W_{tc}$ = propellant mass flowrate, $\frac{lb}{s}$;
$V$ = average specific volume; and
$t_s$ = propellant stay-time, s.
$\frac{A_c}{A_t}$ is contraction ratio,
where $A_c$ is cross-sectional area of the chamber.
$L^*$ is basically a function of residence time of propellants which can be obtained only by experiments.
Also, Contraction ratio and $L^*$ will not exceed a range as exceeding it will result in significant pressure losses in the chamber.