How deep would the pit need to be to get 1 ATM of pressure
That's pretty simple - about 300 km deep. More or less. Depends on how long you expect to keep it.
Atmospheric pressure is simply the weight of gas above the observer. On earth, 99% of the atmosphere is found below 32 km, and 99.9% below 50 km. On the moon, with a surface gravity of 1/6 that of earth, a similar column of gas would be 6 times longer or about 300 km. Since the radius of the moon is about 1700 km, the gravitational gradient down the pit would be about 1/3 - that is, the gravity at the bottom of the pit would be about 67% of the surface gravity. So the surface gas density would be something like that on earth at 33 km.
Could the pit maintain the air or would it be lost to space?
Gone, gone, gone. The pressure of the earth's atmosphere at 33 km is about .017 psi. Unfortunately, it's surrounded by a much better vacuum, and will dissipate at some speed, causing more air to rise and disappear.
If it would be lost, how long would it take?
Sorry, but that's beyond me. Weeks to years, I'd guess.
could a cap be enough to prevent any loss?
Sure. The total pressure difference is pretty small, so for a small-diameter pit a cap seems perfectly reasonable. If you're talking miles wide to support a colony - not so much.
Is the needed depth feasible on the moon?
Nope. With about 1/6 the gravity, this more or less equivalent to a hole 50 km deep on earth. At these depths rock will deform like toothpaste under the weight of the overlying burden. Well, slow toothpaste. Pressure is about 17,000 atmospheres or 260,000 psi. That's pressure in the rock, not the atmosphere.