91 Toyota pickup

I have a 91 Toyota pickup. Few weeks ago setting in drive through truck quit when I turned on a/c. This happened coup,e times then next time I drove it ran fine. Then it stopped two days in row after driving 20 min. Truck would crank but shut down immediately. Waited few minutes and cranked and drove home no problems. Now truck will only run few min. Before stopping and if I turn on fan or lights the truck stops. Swapped battery from another vehicle but did not fix. Alternator seems to be charging fine, checked with meter output 14.5 volts charging. Checked for codes and no codes.

Does it shut down while you rev the engine a bit and then turning the AC on or does it stall while idling?
It could be that the compressor is putting too much strain on the engine.

You might get lucky and happen on the cause but a wiring diagram and a good test light might be necessary

A poor ground can be the cause and that test light can identify a poor ground quickly.