Schmitt trigger with 741 op-amp not behaving as in simulation
The National (now TI) LM741 really is not well characterized to run off of a single \$5\:\text{V}\$ supply rail. The LM741 datasheet suggests that with your loading, you are guaranteed to get within about \$3\:\text{V}\$ of each rail. The typical is better; within about \$1\:\text{V}\$ of each rail. But that's not the guarantee over their range of operation. So, a good argument can be made that the LM741 cannot be assured to work on a \$5\:\text{V}\$ rail.

That said, it's likely that you can make it work here.

To do so, though, I need to consider a way to make sure that a small excursion of the LM741 opamp's output is sufficient to drive something all the way to the rails. You may be able to get the output near \$1\:\text{V}\$, but I'd rather be conservative and figure no better than \$2\:\text{V}\$ above ground. You may also be able to get the output near \$4\:\text{V}\$, but I'd rather be conservative and figure no better than \$3\:\text{V}\$ above ground. Keep it as conservative as possible and work from there.

This discrete output stage can be added to your opamp:







simulate this circuit &ndash; Schematic created using CircuitLab

(Since you don't have a mid-point voltage to use, I had to construct one using the \$R_6\$ and \$R_7\$ voltage divider.)

That's about it. I think that will allow an LM741 to do pretty well in driving a comparator output close to the rails. And it will do so with a fairly credible loading, too (increased output current compliance!)

Of course, there is the obvious option of buying a better opamp for this purpose (or comparator.)