If you ignore that $x$ and $\dot{x}$ are functions of $t$ and just treat them as variables, then the equation defines a function of two variables ($x$ and $\dot{x}$).
If you take account of the fact that $x$ and $\dot{x}$ depend on $t$, then the equation defines a function of one variable ($t$).
Only in case 1 does it make sense to differentiate with respect to $x$, but then it is only a partial derivative (as $f$ is a function of two variables). Let us call the function in (1) $f$ and the function in (2) $h$.
Here $f:\mathbb{R}^2\to\mathbb{R}$ is given by
$$f(a,b)=k^2ga+mkb^2,$$
while $h:\mathbb{R}\to\mathbb{R}$ is given by
$$h(t)=f(x(t),\dot{x}(t))$$
i.e. $h$ is the composition $f\circ (x,\dot{x})$.
We can calculate the following derivatives of $f$:
$$f_1(a,b)=k^2g\qquad \text{and} \qquad f_2(a,b)=2mkb. $$
We can calculate the derivative of $h$ using the chain rule
$$h'(t)=f_1(x(t),\dot{x}(t))\cdot\dot{x}(t)+f_2(x(t),\dot{x}(t))\cdot\ddot{x}(t)=k^2g\cdot\dot{x}(t)+2mk\dot{x}(t)\cdot\ddot{x}(t)$$
In the case where $F=f$, then $\partial F/\partial x$ corresponds to $f_1$ (note the use of $\partial$ rather than $d$ because $F$ is a function of two variables in this case).