Fingers in the mouth are comforting but become a habit. This may naturally continue for a long time while sleeping. He will stop with age, especially if he is embarrassed by his friends.
You can help him stop while doing other things like watching TV by giving him chewing gum. But make sure he brushed after the gum and before sleeping to not leave sugar on his teeth.
There is also a foul tasting liquid available you can put on his thumb, which will work for some but not all boys.