All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Those dollars are considered as Luqatah (lost and found property). If it is few and despised in the people’s custom and the ordinary people do not pay attention to it, then there is nothing wrong with you for what you did of spending it on your friends. But if the ordinary people among you pay attention to these dollars, then you should have announced them when you found them, so you should have looked in the school for the one who lost money; for example, you ask: “Has anyone lost any money?” You can take several means of searching, such as informing the school administration or the lost and found fund, if any, or directly asking the students, or other methods of searching. If you find its owner, you pay it to him. Identifying the lost item continues for one year and if the one who found the lost property does not find its owner, then he owns it.
What you must do now if those dollars have value as we mentioned, take out from your money an equal amount (five dollars), and introduce them to the school, and continue to introduce this lost and found property until it completes one year from the day it was found, and you exceed one year the period during which the lost and found property was not introduced from the first day you found it and took it.
Ibn Qudamah said in Al-Mughni: “If he delays making known the lost and found property to the public for part of the lunar year, then he should make it known for the rest of the year, and completes it in the second year.” [End of the quote]
Then if you do not find its owner, you do not own it because of your failure to make it known. Rather, you must give it in charity.
For more benefit on the Luqatah (lost and found item), please refer to Fataawa 133112, 319984, 354181, 88519 and 7604.
Allah knows best.