I'm just curious if the ATP certificate and working for an airline are prerequisites to being a Captain, or could you have such a title as a PPL or a CPL?
The title "Captain" is not a title bestowed by the FAA. The airlines themselves bestow that title for an ATP rated pilot who has seniority and is shown to be proficient for the airplane flown. A pilot could be deemed "captain" for one flight and "first officer" for another. In the US a pilot must have an ATP certificate to be a "first officer" or "captain".
Could somebody bestow that title on a pilot with only a PPL or CPL? I suppose so, but calling somebody Captain doesn't really say anything about their credentials.
The key phrase, legally speaking, is "pilot in command". On a multi-crew aircraft the PIC is normally given the honorific title of Captain, but what really matters is the legal status of PIC where an aircraft legally requires more than one crew. In general to be PIC of a multi-crew a/c you need an ATPL. Operators may operate single-pilot aircraft like Caravans as if they were multi-crew with two pilots and call the PIC Capt, but again that's just an honorific title and in that case the PIC can be just a CPL.
Like DLH says, a PPL or CPL can call themselves anything they want; Captain, Great Exalted Poobah, Zontar The Munificent, whatever.
When Pan-Am created the first modern airline, most passengers of that era were familiar with the practice of ships having a naval-uniformed "Captain" and/or "First Officer" that greeted them on boarding. Pan-Am decided to copy that practice by dressing the pilots of their "flying boats" dress in the same uniforms and use the same titles, in hopes this would set themselves apart from barnstormers (who frequently killed themselves and their passengers) as a "professional" outfit and put passengers at ease. Other airlines soon copied the practice, and it has survived to this day despite the move to land-based planes long ago. However, the titles have absolutely no legal status, unlike with ships.
Legally, what matters for flying is the "Pilot in Command" and, for aircraft that require one, the "Second in Command". The type of pilot license required for each varies by country, type/size of aircraft, and whether the flight is scheduled, charter or private. For example, a student pilot can be "Pilot in Command" of a single-engine trainer as long as they are not carrying passengers and have the correct endorsements from their instructor.