Could be alternator or battery or both since one can lead to the other failing.
How old is the battery? Could also be corroded cables. Take battery to get it tested and/or replaced. Check connections and cables for corrosion. Alternators are pretty easy to replace if the other things check out.