Micah's answer reminded me of when I had recently watched the DS9 episode Past Tense: Part 1 .
There is a scene where Sisko and Bashir are filling out forms in Sanctuary District A, when Sisko realizes what day it is.
As he's explaining the events that will occur a few days later, we get this shot of a screen on the wall: As you can see, the temperature is listed in degrees Celsius.
Since they are in a US government building, I think it's reasonable to assume that the US had switched to using Celsius at least by Friday, August 30th, 2024.
Since this predates the formation of the United Earth government, I think it's reasonable to assume they always used the metric system, at least for temperature.
scifi.stackexchange.com/users/46611/DaaaahWhoosh
So far as I can tell, nobody in Star Trek from the near future ever uses anything but the metric system .
We see people from future Earth in the following years: 2024, in the DS9
2-parter "Past Tense".
To the best of my searching ability, none of them use any units at all.
2036, in the Voyager episode "One Small Step".
There's some brief dialogue at the beginning of the episode between astronauts which involves metric units.
2050, at the very end of the Voyager episode "11:59".
There's only one line, with no units in it.
2063
, in Star Trek: First Contact .
Lily talks about the cockpit of the Phoenix being four meters long.
When Riker reports the Phoenix 's speed (presumably reading off the instrumentation that Cochrane and Lily installed), it's in kilometers per second. ...
and then we're into the backstory of the Enterprise crew, in "Broken Bow" and "First Flight.
" I can't find any humans using units (other than warp-scale numbers) in any of the flashback scenes in either of them.
However, one Vulcan in "First Flight" does quote a length in kilometers; as they're not a Vulcan unit, this probably means the humans he's talking to use them.
So everyone who uses units, from the present up until the Enterprise era, uses the metric system.
That said, everyone who uses units, from the present up until the Enterprise era, is some kind of astronaut or scientist who might very well be using metric even if they were a present day American.
So this is all kind of shaky.
It's really too bad "
Past Tense" doesn't have any units in it, as none of its past characters are scientists or astronauts.
Additionally, there seems to have been a revival of imperial/customary units in the 23rd century; for example, in "The Doomsday Machine," atmospheric pressure aboard the Constellation is reported as "eleven pounds per square inch."
Though you could just chalk that up to Early Installment Weirdness ...
scifi.stackexchange.com/users/6217/Micah
For now, only two or three countries uses the Imperial system.
In the future, probably no one is going to.
As United Earth was the unification of Earth, It's probably that they chose the most used - the metric system over other systems.
So I presume when It was created either all countries already used the metric system or It was chosen as the official one after it's creation.
I sincerely hope I could give you some information.
scifi.stackexchange.com/users/38264/Mateus Guimarães
Bear in mind that the Imperial system is completely useless in engineering applications, and never used or taught in science or engineering courses at college or university.
So in answer to your question, Earth already uses the metric system in serious applications.
While the general public may still use imperial measurements on a united Earth, we only ever see starship crews and being trained in a variety of scientific and engineering disciplines, they'd all be used to metric anyway.
scifi.stackexchange.com/users/72449/Cooper
In the episode "Arena" S1/Ep18 Spock gives out the distance of enemy ground forces in yards measurements.
scifi.stackexchange.com/users/78299/Chas
When the crew of the Enterprise are talking to the food replicators on board about a beverage, they state the temperature in Celcius. Is there any record of when United Earth as a whole adopted the metric system?
When Did United Earth Switch to the Metric System?
scifi.stackexchange.com
<star-trek><star-trek-tng>
scifi.stackexchange.com/questions/76076
scifi.stackexchange.com/users/32656/Ryguy
As United Earth was the unification of Earth, It's probably that they chose the most used - the metric system over other systems. The metric system is also most commonly used in engineering and scientific disciplines. One might assume that when United Earth was created, either all countries already used the metric system or it was chosen as the official system later on. However, claims are made that this happened in 2036 or 2050. Although there is no concrete evidence of when the metric system was adopted by United Earth, the starship crews have always been used to working in the metric system due to their scientific and engineering backgrounds and the year 2036 and 2050 feature in Star Trek: Voyager as possible answers to the question. 
In the Voyager episode "One Small Step", the year 2036 is mentioned. At the very end of the Voyager episode, the year 2050 is mentioned. The metric system is the official system in science and engineering so the Starship crews are used to working in metric. 