The word "relic" can refer to many "old things". For this entry we are interested in one meaning only: A relic is an object of religious veneration, especially a piece of the body or a personal item of Muhammad (or another saint or holy man venerated by some Muslim groups).
Muhammad's hair and nail clippings were collected as relics. Muhammad did not disapprove of this.
Narrated Ibn Sirrn: I said to 'Ablda, "I have some of the hair of the Prophet which I got from Anas or from his family." 'Abida replied. "No doubt if I had a single hair of that it would have been dearer to me than the whole world and whatever is in it." (Sahih Al-Bukhari 1.171)
Narrated Anas: When Allah's Apostle got his head shaved, Abu- Talha was the first to take some of his hair. (Sahih Al-Bukhari 1.172)