A car battery can usually last and stay charged enough to start a car after sitting for 2 weeks to a month at a time.
To keep your cars battery charged you should start the engine for 5 or 10 minutes at least once per week and take the car around for a small drive.
That also keeps your tires from developing flat spots and going bad just sitting in one spot.
Some car batteries may last and stay charged for a few months in the car without starting the car.
But you should use a trickle charger or at least start the car every week to keep the battery from going bad.
Ideally take the car for a short drive of even around the block a few times to help keep the battery up and keep the tires rolling.