Rapid clicking: usually the battery
The solenoid needs relatively little current, the starter motor needs a great deal. When the battery can supply the first but not the second, the solenoid engages, voltage collapses, it disengages, voltage recovers, and it engages again — many times a second. That is the clicking.
One loud click: usually the starter
If dash lights stay strong and you get a single solid clunk with no cranking, the battery is delivering current and the starter is not converting it into rotation. That is a starter motor or its heavy cable, not a charging problem.
It starts fine after a jump, then dies again
That is the alternator or a parasitic drain. If the car runs after a jump but dies once disconnected, the alternator is likely not charging. If it runs fine all day then is flat every morning, something is staying awake overnight.
Check the terminals first, honestly
Corroded or loose battery terminals produce exactly these symptoms and cost nothing to check. Look for white or blue-green powder on the posts. It is worth two minutes before it is worth a repair bill.