Foul smelling water from borewell

Borewell of 250 feet depth

I dug a borewell of 250 feet depth. The water was clear and we were using it for the past 5 years. The water has a bad smell some days; this has occured 3 - 4 times in the past year. What is the reason and how can we solve this problem?