I made an Arduino pulses counter that read led flashes with a fotoresistor.
Photo resistors are very slow and might not be fast enough to count the flashes on your LED, how fast is it flashing?
Are you sure your code is counting the pulses correctly and not continuing to increment the counter when ever the threshold is exceeded? That is when you exceed a threshold do you do nothing until the reading is then less than the threshold. Try making the up and down thresholds different, this is called hysteresis.
Probably the noise is generated by Arduino:
This is unlikely. What is your circuit?