Hi KellyXu
Well, I think a 'gambling ticket' suggests a piece of paper that you are given when you go to a bookmaker and place a bet. Evidence that you have made the bet. Like a receipt. If you bet on a horse race you would need to provide the 'ticket' to collect your winnings. In the UK we normally call this a 'betting slip'. Not sure what the term is in the US or other English speaking countries.
What does the simile 'like a gambling ticket' mean in this context? To be honest, I am not sure, perhaps it means that the character feels as though someone else will one day give him/her to some other person in exchange for money. Maybe his/her parents have spent a lot of money on educating the character in the belief that when the character grows up he/she will provide for them financially (sorry if this sentence is a bit complicated, it's a complicated idea to express!).
On the other hand if you are reading a book that has been translated into English from another language, then perhaps, this phrase is an idiom in that language?
I hope this helps
Chris