I will attempt to answer two specific parts of your question and I will do so using two assumptions.
Assumption 1) You are talking about the "Golden Age of Piracy" in the Caribbean or Indian Ocean.
Assumption 2) You are a fugitive (not privateer) and cannot gain access to a dry dock by bribing a local governor or passing off as an upstanding citizen.
With that said, the ocean could be very tough on wooden vessels and those vessels required constant cleaning an upkeep do primarily to a process called biofouling which is essentially the buildup of stuff like algae and barnacles on the ship that cause the ship to deteriorate more quickly. You have probably observed this yourself near the water line on a dock or pier. This days nothing of the damage caused by accidents or fighting. Your whole ship could basically rot out beneath you rather quickly in warm waters like the Caribbean if you didn't care for it properly.
To clean and/or repair a ship without a dry dock, you would have relied on a process called careening. Careening a ship is when you basically beach the ship and tilt it to gain access to one side. You could do this ideally on an object like a large (not sharp) rock on a Sandy beach at high tide. You do this carefully and in such a way that when the tide goes out, the boat tips to the side (not all the way for obvious reasons) and you can scrub all that gunk off one side of your ship and repair any holes or whatever you've got to do. Then when the tide comes back in you are free and can go about your way. Of course, you'll have to do it again on the other side so it's a 2 day process at least.
In terms of labor, if you have prisoners, you could force them to do the labor but usually it would be the crew. Pirates generally did not take prisoners as often as we think and when they did, would not keep them longer than necessary. Also, do to reasons I'll discuss shortly, you wouldn't likely want to show prisoners (whom you intended to set free) where you do your careening.
Now, as far as location, you have to remember that geography plays into it a lot. You are a fugitive so you need a secluded bay, not just an open beach that someone can see from the trade routes. The bay needs to be away from "prying eyes" because you are pretty screwed if another ship comes and bottles you in the harbor while you are careening. If this happens your options are likely a Canon, a jungle by yourself, of the gallows. Luckily for the pirates secluded bays were all over the Caribbean and the western Indian Ocean. You can't use the same spot over and over though because once the word gets out, the Navy will show up.
Myy favorite part of all this because it is so engenious is this... Not all of the secluded bays had an appropriate large rock or object to careen on. In fact, many did not. For this reason, pirates could capture smaller trading vessels and take them to a bay where the smaller vessel would be capsized in shallow water and its Hull used as a substitute for the large rock needed for careening.
If a secluded bay with an appropriate rock was not available and a smaller ship also unavailable they could simply beach the boat in the sand when the tide went out. Hook a crap ton of ropes to the boat and pull or use a tree or rock on land as an anchor to start it tipping as the tide goes out. This was understandably a very difficult task and would be the last method preferred to the other 2 (rock or small ship) since it was more work. It may however have been the most used method since it could be done almost anywhere you had a gently sloping beach.
Whatever method you chose, the ship would be unloaded first and you'd be camping on the beach so hopefully you could find some water and food while you're were there as fresh food was hard to come by on the high seas.
Good luck with your pirating Captain.
P.S. an excellent source for all things pirates if your interested... "The Republic of Pirates" by Colin Woodard.
An important thing to consider is that the legal status of many pirates in the 17th and 18th century (and after, for that matter) was ambiguous. For English and North American pirates operating in the Western Hemisphere and Indian Ocean, many concurrently held privateer comissions, issued by a bewildering variety of local authorities, and they attemped with frequent success to cloak their depredations with legality by claiming they were legal captures. Often these letters of marque were issued under the flimsiest of pretenses, or were otherwise of questionable legality (say, for example, issued by a colonial governor against a state the mother country wasn't at war with). Religious tension likewise complicated matters, as some Christian pirates felt themselves justified in seizing Muslim ships, and vice versa. Mughal and other ships from South Asia bound for Mecca were popular targets for European and American pirates operating from Madagascar in this era for this very reason.
Some colonial governors issued these questionable privateer commissions out of greed, others out of a sense of duty for the welfare of their colonies. Pirates from British America were, in several cases, pillars of the local community, celebrated for their exploits and the coin and precious metals they brought back to communities usually starved of specie. They were protected, sheltered, and even sponsored by their communities. In those cases, they relied on community support and supplied themselves freely from their home ports.
As British imperial authorities cracked down on piracy (as part of a broad regularization of imperial governance in the 18th century), pirates did increasingly rely on plunder or on lawless pirate nests (like the celebrated case of Nassau, Bahamas - the scene of the TV show Black Sails). Still, for most of the golden age of Atlantic piracy, pirates could rely on inter-imperial competition or colonial neglect to provide them with safe haven and shelter.
Sources:
Mark Hanna, "Pirate Nests and the Rise of the British Empire, 1570-1740" (UNC Press) is really, really good. Hanna shows very convincingly how and why local communities and the law sheltered English (and later, British colonial) pirates.
Markus Rediker's "Villains of All Nations" is a great study of the social history and daily life of Atlantic pirates.
In "If A Pirate I Must Be" by Richard Sanders, there's a section that talks about resources/supplies as a pirate. There's essentially two levels of pirate - privateer, which means you've got a green card from your king or queen to do almost whatever you need to, or pirate, who work outside the law. Privateers can dock because they can show their proof of support, while pirates can't. Pirates depended on boarding other ships and taking their supplies in order to gather food/resources. Often the first people on board a captured ship are the cook and medical staff (if any) to take what they need, then the crew are allowed to board the captured ship to plunder anything they can.
As for infrastructure, there was a pirate stronghold on Hispanolia (now Haiti/Dominican) and in Port Royal, Jamaica. Port Royal was destroyed by earthquake in 1692, so another stronghold popped up in the Bahamas soon after. Sanders describes the Bahamas as being perfect for pirates due to the confusing and intricate geography, and he goes on to say that "there was even a sail-maker's widow who made a living stitching black flags, for which she was paid in brandy." (27) One can assume that other services existed in those locations for pirates to use, although what those services were exactly I can only speculate on.
Sanders' book is a good read, if a little wordy and drawn-out.