How can you tell whether an iPhone needs a new battery or just needs to be charged?
Check Settings > Battery > Battery Health & Charging. When Maximum Capacity drops below 80%, your iPhone will suggest a replacement. If the battery icon isn't full, it just needs a charge. Keeping it plugged in helps the phone manage charging and extends battery life. When you can't get much use between charges, it's time for a new battery.