It usually is the magazine. If the followers are metal, sometimes you have to tweak them. Weak mag springs are another culprit. If the slide stop is tight, try greasing it lightly. Failure to lock back can also becaused by "limp wristing" while shooting or "short cycling" (the latter is caused by stiff recoil springs/new gun tightness/weak ammo).
Will the slide lock back manually with a mag inserted? I mean can you insert the mag, pull the slide back and have it lock? If it will, you recoil spring is too heavy and the slide isn't coming back far enough to allow the mag follower to kick up the slide release.
If it won't (the test), is usually means the mag follower is either missing the lug on the slide stop, or the spring can't exert enough pressure to kick the follower and lug up fast enough to catch the lockback notch as the slide passes.
We could use some more info...like make of gun, ammo used, recoil spring weight. etc.
Take a look at the left side, front of the mag follower as you push the mag up into position. You should be able to see if the follower engages the slide stop lug and moves it up, or if it misses the lug completely. If it contacts but doesn't move the lever up, something is binding on the slide stop lever If it doesn't contact the lug, you'll have to find out why the lug is not going into the frame far enough. Who knows, you may have a .38 super slide stop in there...they're shorter than the .45 ACP.
You still didn't give us any additional info to help diagnose this problem.
Are you using any type of a Shokbuff? It will sometimes prevent the slide from going back far enough to let the slide stop engage the notch in the slide. The slide stop may also be out of spec. and not have enough "meat" where it should be engaged by the magazine follower. I'de suggest removing the Shokbuff if you have one installed, then trying a new slide stop next.