It's all in the question name.
256 steps. The chance it resets is not guaranteed, but it has a small chance to do so every 256 steps. If it resets, 40% it will be an item, 40% it will be a hidden item and 20% that it will be a Pokemon.
Source