Possible battery/alternator issues?

A few months ago I was waiting for my fiance to run into the store while I stayed in the car. I turned off the engine but left the electricity on to listen to music. It was only about five minutes or so that I waited but when I tried to turn the car back on it didn’t start. We got a jump and went to auto zone to get it checked out. They read the codes and said it was a problem with the alternator. We were pretty broke at the time so we just bought a mobile jump starter until we had some money to take it to the shop and get it replaced. But then everything was fine, didn’t have an issue with the car not starting. It wasn’t until about two weeks ago that I went to go to work in the morning and the car would not start again. Got a jump start once more and has since been fine. I don’t know if it was having problems that time as it was just starting to get very cold and I park in an open car port. But I’m just wondering if anyone has any idea if this sounds like a problem with the alternator or battery? I figured that if it was the alternator, it wouldn’t have lasted this long running fine. And I don’t know how old the battery is, as I bought the car about eight months ago. Any input would be much appreciated.

You need the charging system and battery tested, an alternator can fail completely or partially. A simple test with a voltmeter will tell you if it is putting the 14 to 14.2 volts it should while running. The belt driving the alternator could be slipping. Also check the date code on the battery. If you don’t know how, google it.