Is it possible to purchase a camping site for say- 3 nights and come and go as you like, knowing that you to have a spot when you come in late on any given night ?
Seems like this varies from campground to campground. But even if the campground you choose allows payment of only one night at a time all you have to do is leave something to indicate occupancy and pay for the next night before leaving in the morning.
If your tent is set up in a campground that is a good sign of occupancy.
I think every National Park campground I've ever stayed at will let you pay for multiple nights ahead of time, BUT with the understanding that there are NO refunds possible, so if you pay for 4 nights and then decide to leave after 2 nights, too bad.
Different campground attendants have different systems, but basically you fill out the little payment stub and clip it on your camp-site and it will indicate how many nights you're staying. So even if they want you to pay each day, you can fill out the form indicating you're staying 4 nights. Plus any sign of occupancy will hold your site for you. If you pack up all your gear and clear out the campsite every day, then there's a chance you could lose the site. But like EarMtn said, a tent is a pretty sure sign the site is occupied, but even just a couple lawn chairs will probably do it, but don't try to reserver your spot by leaving a cooler out at the site, it will be gone when you get back and you'll have a ticket waiting for you! All food and food prep utensils must be kept in a hard-sided vehicle, even a clean empty cooking pot is a no-no.
If I remember correctly, the National Park campground will allow you to stay either 7 nights or 14 nights before you have to move, so you can pay for what ever nights you want up to the limit and fill out the tag(or the host will fill out the tag) indicating the number of nights paid for, I normally leave my tent set up or if sleeping in the car, I will leave a lawn chair in the parking spot while I am gone, I have also made up a small wood sign with the word "Occupied" and stick it in the ground at the camp site, it just depends on where I am staying..
You should not have any problems, most every campground has a host you can talk to, to get the best information at that campground.
We often do two to four nights at one location in Glacier. We have done this at Many, Two Med Kintla and Bowman. You can do it a night at a time by re-registering each morning or include multiple nights (with payment) when you first arrive. After a long dayhike its good to know you have a spot to come back to.