In the anime version of My Hero Academia it's said that Endeavor solved more crimes than All Might, but he isnt considered the number one hero in spite of this. Why it is so? What does it make people to consider All Might the number one hero and not Endeavor?
I don't think there is a clear reason stated for that, but I think it has to do with what heroes are supposed to be in the MHA world: they're not just cops, they're something more than that.
They're supposed to inspire people
In MHA, most children hope to become professional heroes themselves, which mean that, most likely, heroes are idolised, and many people see them as much as heroes as they see them as public figures.
Their behaviors, the way they treat their fans, all of that will play a part on how a hero is perceived, if he is better or worse than another hero. And as we have seen multiple times, Endeavor's behavior is not that great. I can see why some people would not see him like a great hero (Heck I'd even say that he is closer to a villain than to a hero).
They're supposed to do other things than just resolving incidents
When Tsuyu goes to do her internship, we can see that heroes can be doing other things that doesn't always involve apprehending villains, patrolling water, patrolling streets, etc etc.
Rescues is one other of the major points of being a hero, and, with Endeavor's ability (and personality) I'd wage that rescuing people from a disaster is not what he's the best at (fire isn't really suited in most disastrous situations), while All Might is known to be able to save tons of people quickly.
Number of incident, against gravity
While he solved the most incident in MHA, we don't know the severity of those incident, while we have seen him at work, and we know that he is not weak at all, he could very well have solved hundred of small incident involving petty criminals.
So in short, the reason why he isn't the number 1 hero, is because he is the best in only one area of his work, All Might is better everywhere else.