Do I have an obligation to give back extra change I receive? Would it matter if the store owner or person giving it to me was a Jew?
(Source: this article on Torah.org)
If the one who made the mistake is a Jew: Absolutely yes, you must return it.
If the one who made the mistake is a non-Jew: there's lots of discussion, and it appears it's not so clear. But remember: doing so anyways will create a Kiddush Hashem (and is probably the right thing to do).
To quote a relevant story retold by Rabbi Pinchos Bodner:
Rav Yaakov Kaminetsky zt"l recounted that when he was a Rabbi in Lithuania before World War 2, he was asked a question by a resident of his community. The man had purchased stamps from the local post office, and had received more stamps that he had paid for. For such a poor man, the extra stamps were no trifle matter. Nonetheless, Rav Kaminetsky suspected that perhaps the postal clerk was testing the rabbi. This suspicion was confirmed a short time later when the clerk gave him too much change. The rabbi returned the extra money. Many years after the Nazis came and destroyed the community, the rabbi heard that this clerk had saved many Jews, testifying that he tested everybody to assess their honesty, the only trustworthy people were the Jews!
The general principle involved here is טעות עכו"ם - mistakes of a non-Jew. Halachically giving the wrong change is a mistake falls under the general rubric of returning lost objects. Halacha requires one to go to great lengths to return lost objects, but limits this to fellow Jews. If something is found in a location where it is most likely that it was a non-Jews item, then there is no such obligation.
This case falls under that category. By making the mistake, they essentially lost something, and you don't have to return it. However, there are several caveats to this.
You can't do anything to cause or mislead the non-Jew in this calculation. They have to make the mistake on their own due to no fault of yours.
Some opinions say that you have to explicitly state that you are relying on their calculation and they shouldn't think you are checking them and rely on you to catch a mistake. So if they are taking the wrong amount of change out the cash register, you may have to say something like "I assume you are giving me the right change".
It is an appropriate and pious attribute to point out the mistake and correct it if it will cause a Kiddush Hashem (as the story of Shimon ben Shetach).
If it can cause a Chillul Hashem it is forbidden to let the mistake pass.
According to Sefer Chassidim 358 a non Jew who keeps the 7 Mitzvos is part of the requirement of returning lost objects (it isn't clear to me if this is a mater of piousness or a base requirement) and thus does not fall under this category of "mistakes of a non-Jew".
The Tzomet institute has a long article on this and other subjects relating to monetary dealings with non-Jews which has a nice collection of sources (including that rather obscure Sefer Chassidim reference).
Adapted from my answer to this similar question.