Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Purchasing stolen items after knowing their reality is forbidden since it is a kind of cooperation in sin and with the thief as well. Allah Says (interpretation of meaning): {…but do not help one another in sin and transgression. …..}[5:2].
Selling the stolen items is also forbidden since a thief is not their real owner while Shariah approves of selling only what one owns. Thus, the one who has purchased something from a thief has to return it to its real owner and should take his amount back from the thief. The Prophet (Sallallahu Alaihi wa Sallam) said: “If a person's belongings are stolen or he loses them, and if he finds the same belongings with a person, the owner is more entitled to take them, and the purchaser has to take his amount back from the seller". Reported by Imam Ahmad, Sheikh al-Arnawoot considered it as a good Hadith.
Therefore, your friend is not allowed to use the computer and he has to give it back to its real owner if he knows him; otherwise, he has to spend its price in charity. He can demand its price from its seller, if he refuses to pay him back the amount he had paid him, he may sue him in an Islamic court or he may forgive him and receive the reward on the Day of Judgement. May Allah bless you and us.
Allah knows best.