Jim got rich when they found a chest of gold hidden inside the cave that the 'bad guys' hid them in (kinda forgot what they were called). They were going to hide it longer, but when the (aunt?) said that she didn't have enough money to support Jim to go to school, Tom got the money out and showed that 'Jim was rich'
They found it in the cave pretty much
hope this helps