First of all I must say that I completely agree with the explanations given by the colleague Harald Khandavalli and I add.
The control law for an LQR regulator is of the form:
u (t) = -Kx (t)
And the expression giving the gain matrix K is:
K = R-1 BT P
So the link between the cost function 'J' and the gain is the matrix R of weighting of the control energy, the choice of matrices R and Q is to find a compromise the best possible according to the desired performance.