He was given more money than he was entitled to
Firstly: in all the cases mentioned above, you must give back to people what is their due. It is not permissible for you to take the money of other people if they forget or make a mistake. What you have been given does not belong to you and it is not permissible for you to take it. If something is credited to your account by mistake or because of forgetfulness, it is not permissible for you to take it. This is indicated by all the evidence of sharee’ah.
Allaah says (interpretation of the meaning):
“O you who believe! Eat not up your property among yourselves unjustly except it be a trade amongst you, by mutual consent”
“Verily, Allaah commands that you should render back the trusts to those, to whom they are due; and that when you judge between men, you judge with justice. Verily, how excellent is the teaching which He (Allaah) gives you! Truly, Allaah is Ever All-Hearer, All-Seer”
It was narrated from Abu Hurayrah that the Prophet (peace and blessings of Allaah be upon him) said: “The signs of a hypocrite are three: when he speaks he lies, when he makes a promise he breaks it, and when he is entrusted with something he breaks that trust.” (Narrated by al-Bukhaari, 33; Muslim, 59).
Ahmad (94, 23) narrated that the Prophet (peace and blessings of Allaah be upon him) said: “It is not permissible for a man to take his brother’s wealth unlawfully.” That is because Allaah has forbidden the Muslim to take his fellow-Muslim’s wealth.
According to a report narrated by Ibn Hibbaan (13/317): The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “It is not permissible for a Muslim to take his brother’s stick without his consent.” Classed as saheeh by Shaykh al-Albaani in Ghaayat al-Muraam, 456.
It was narrated that Abu Humayd al-Saa’idi said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “… By Allaah, no one of you takes something unlawfully but he will meet Allaah carrying it on the Day of Resurrection. So I will recognize one of you meeting Allaah carrying a camel bellowing, or a cow mooing, or a sheep bleating.” Then he raised his hand until the whiteness of his armpit could be seen, and he said, “O Allaah, have I conveyed (the message)?”
Narrated by al-Bukhaari, 6578; Muslim, 1832.
But if the owner of the money has given you more than you are entitled to, then that belongs to you and there is nothing wrong with that, because the Prophet (peace and blessings of Allaah be upon him) said: “Whatever of this wealth comes to you and you were not hoping for it or asking for it, then take it, otherwise do not hope for it.” (Narrated by al-Bukhaari, 1473; Muslim, 1045).
And Allaah knows best.