Maybe this should be in r/askscience because I wasn't sure if this was an evolutionary biology question or maybe something that could be answered from a historical/anthropological perspective. I'll move it if I'm in the wrong place
We don't know for sure but most evidence suggests that Humans were "hairless" long before clothing. The first hominin typically identified as "hairless" is Homo ergaster (often called African Homo erectus) a species of human that emerged in Africa in the early Pleistocene (c. 1.8-1.7 Ma.). Archeological evidence for exactly when clothing emerged is somewhat scarce (with physical evidence more or less confined to around 25,000 years ago or later) but studies suggest its invention was certainly far more recent - in the late Pleistocene, likely within the last 100,000 years and at the very least within the last 200,000 years (likely invented independently by both early "modern" humans - H. sapiens - and Neanderthals). A study by Kittler et al. (2003) which looked at the evolution of body lice which live on clothing suggest clothes emerged roughly 72,000 ± 42,000 years ago. Another similar study by Toups et al (2011) estimated between 170,000 and 83,000 years ago. This doesn't necessarily rule out earlier origins for clothes, particularly as their is evidence that earlier species like Homo heidelbergensis (c. 600,000 years ago) used tools for carving animal hides but we don't have evidence that they actually used hides for clothing.
Sources:
Klein, Richard G. The human career human biological and cultural origins. Chicago: University of Chicago Press, 2009.
Kittler, Ralf, Manfred Kayser, and Mark Stoneking. "Molecular Evolution of Pediculus humanus and the Origin of Clothing." Current Biology 13, no. 16 (2003): 1414-417.
Melissa A. Toups, Andrew Kitchen, Jessica E. Light, David L. Reed. "Origin of Clothing Lice Indicates Early Clothing Use by Anatomically Modern Humans in Africa." Mol Biol Evol 2011, 28 (1): 29-32.
Hi, the better fit for questions on early man would be our sister sub, /r/AskAnthropology. There are some anthropologists here, and the question can stay here, but this sub's focus is on later time periods.