It could be a number of things:
- Bad connection or corrosion on battery cables
- Dead cell in the battery would prevent it from charging fully
- Bad or worn drive belt would slip, preventing the alternator from fully charging the battery
- Bad alternator
If the car will run at idle with all accessories turned on, the alternator is good and you should concentrate on the battery and battery cables. If the car won't idle, then the drive belt and/or alternator could be the issue. If the car starts everytime when it's cold and only gives you a problem starting when the engine is hot, the starter could be the issue. A bad starter will often work when it's cold (after sitting a few hours or overnight). When a bad starter gets hot, it takes more and more power to get it to turn over.
Overall, I'd have the electrical system checked out. Most chain auto parts stores (Autozone, Advance Auto) will do a complimentary electrical test for you.