Let \( x \) be the total number of tickets sold in the raffle. James buys 4 tickets, and the probability of winning with those tickets is given by the formula:
\[ \text{Probability of winning} = \frac{\text{Number of tickets bought}}{\text{Total number of tickets sold}} = \frac{4}{x} \]
According to the problem, his chances of winning are \( \frac{1}{125} \). Setting the two expressions equal gives us:
\[ \frac{4}{x} = \frac{1}{125} \]
To find \( x \), we can cross-multiply:
\[ 4 \cdot 125 = 1 \cdot x \]
Calculating \( 4 \cdot 125 \):
\[ 4 \cdot 125 = 500 \]
Thus, we have:
\[ x = 500 \]
So, the total number of tickets sold is
\[ \boxed{500} \]