Is it prohibited in Islam for an orphan to earn money by gambling, based on which s/he wants to become independent in life and not to ask others for help?
Allah says in the Quran:
They ask you about wine and gambling. Say, "In them is great sin and [yet, some] benefit for people. But their sin is greater than their benefit." And they ask you what they should spend. Say, "The excess [beyond needs]." Thus Allah makes clear to you the verses [of revelation] that you might give thought. [2:219]
This clearly indicates that Gambling is forbidden just as wine is.
Your question indicates that this orphan has only 2 options: Gambling or panhandling (asking people for money). Can't this orphan make money by working?
I am pretty sure if he goes around asking people for offhand jobs he would find any. If he is living in a society that doesn't allow him to work because of his age, such societies generally have social programs to help with shelter and food.
It is better for him to panhandle, save money and start some sort of business instead of Gambling.
Doing Haram stuff should be the last resort, say for example no one would give him money and he needs money to survive and the only way to do it is by Gambling.