The literal translation appears to be "Ich lerne Deutsch in meiner Freizeit".
Is this a natural sentence in German?
The sentence you gave is perfectly fine. In most cases
In meiner Freizeit lerne ich Deutsch.
would be more idiomatic. But I can imagine cases where the sentence you gave would be preferred over the latter sentence. Consider this:
Ich lerne Deutsch in meiner Freizeit, Russisch aber im Dienst - und zwar im Rahmen meines Aufbaustudiums.
In the same context there are several options. The same person could say - and may prefer:
Deutsch lerne ich in meiner Freizeit, Russisch aber im Dienst - und zwar im Rahmen meines Aufbaustudiums.
Your translation is perfect. It is one of the possibilities German native speakers would use:
Ich lerne Deutsch in meiner Freizeit.
Ich lerne in meiner Freizeit Deutsch.
In meiner Freizeit lerne ich Deutsch.
All three are good style and sound normal. None of the three is better or worse than the others.
The following sentence is also possible (since it is a correct German sentence):
Deutsch lerne ich in meiner Freizeit.
But you better should use one of the former three sentences. German is very tolerant to word-order, so the last version is grammatically correct, but it is rarely used and sounds a little bit strange.
In German one would say:
In meiner Freizeit lerne ich Deutsch.