The droid duo have had many, many owners over the years.
Before The Phantom Menace
C-3PO
- 112 BBY: An unknown owner on the Cybot Galactica foundry world of Affa (C-3PO entry on the official Star Wars Databank)
- Before 32 BBY: An unknown owner, tasking C-3PO as emissary of the Manakron system (C-3PO entry on the official Star Wars Databank)
Around the time of The Phantom Menace
R2-D2
- 32 BBY: The Royal Engineers of Naboo, assigned aboard Queen Amidala's Royal Starship (The Phantom Menace)
C-3PO
- Early 32 BBY: Anakin Skywalker, who rebuilt him from parts (The Phantom Menace)
- Late 32 BBY: Shmi Skywalker, after Anakin left him with her (The Phantom Menace)
Around the time of Attack of the Clones
R2-D2
- 25 BBY: Padmé Amidala, remaining in her service when she joined the Galactic Senate (Attack of the Clones)
- 22 BBY: Anakin Skywalker, given as a wedding gift by Padmé (The Complete Star Wars Encyclopedia)
C-3PO
- 27 BBY: Clieg Lars, bought along with Shmi Skywalker (Revenge of the Sith novelization*)
- 22 BBY: Anakin Skywalker, given as a gift by the Lars family after his mother's death (Attack of the Clones)
- 22 BBY: Padmé Amidala, given as a wedding gift by Anakin (The Complete Star Wars Encyclopedia)
Around the time of Revenge of the Sith
From here on out, the droids are always owned by the same person, unless otherwise stated.
- 19 BBY: Bail Organa, inheriting the droids after Padmé dies and Anakin falls to the dark side (Revenge of the Sith novelization*)
- 19 BBY: Captain Raymus Antilles, gifted from Bail Organa (Revenge of the Sith)
Between 19 BBY and 2 BBY, the droids had a lot of owners, mostly described in the Star Wars: Droids TV show and two comic book series. It was a pretty regular occurrence for them to change owners during this run.
Note that in Legends continuity, this is pretty much all S-Canon, meaning that it is a lower level of canon than the movies or other material post 1990 or so, and is often ignored in later works.
- Lok Revenants, a band of pirates who captured the droids
- Lott Kemp, a crystal merchant
- Jost Ellon, an orphan
- Ambassador Zell of Majoor, to act as companions for his son Llez
- The Republic Diplomatic Corps, serving as couriers
- Van P. Quist, owner of "The Droid Store" after they wandered in
- (R2-D2 only) Kirk Windjammer, sailor (yup, on the water, not a starship) after purchasing him
- (C-3PO only) Gavern Starlock baron and advisor of R-duba after purchasing him
- Kirk Windjammer, taking the position of advisor from Starlock, and gaining C-3PO
- Sindee, businesswoman, after the droids were left at her refueling station
- Zevel Hortine, smuggler, after being gambled in a game of Liar's Cut
- Thall Joben and Jord Dusat, speeder jockeys after finding the droids after they were jettisoned from Hortine's cargo hold (these guys actually had the droids for a pretty long time)
- Yorpo Mog, bodyguard of Zellock, who bought him in a public auction
- Jann Tosh, miner, who traded Mog for the droids almost immediately
- During this time, they met the space pirate Kybo Ren. No relation to Kylo Ren.
- A spaceport hotel on the planet Manda, after Tosh was accepted into the Imperial academy and he sold them to the hotel for use in manual labor
- Mungo Baobab, heir to the Baobab Merchant Fleet, who purchased the droids from the hotel
- Krellus Barzane, "renegade technolord", after jealous researchers who were part of the Baobab Merchant Fleet "accidentally" sold them
- Jann Tosh, recovered from Barzane
- Governor Wena Havid of the Kalarba system, ambassador who purchased the droids
- Unidentified junk trader, who won them at an auction when Havid needed money
- Nak Pitareeze and his family, Olag Greck, and Jace Forno
- Zorneth, Ithorian botanist
- Councelor Harthan, diplomat
- Larka Nimondro, traveler
- Other unspecified owners (C-3PO: Tales of the Golden Droid)
Almost all of these happened in one of the Droids series or another one-shot comic designed as a tie-in. Many of these owners are described on the Star Wars website at The Droids Re-Animated Part 1 and Part 2.
Before A New Hope
- 2 BBY: Captain Raymus Antilles (Referenced in A New Hope)
- Between 2 BBY and 0 BBY: The Star Tours interstellar travel agency (on loan from Antilles)
Yes, there is a Legends canon reason for why the droids are part of the Star Tours theme park ride in Walt Disney World.
A New Hope
- 0 BBY: Jawas, found as salvage (A New Hope)
- 0 BBY: Owen Lars, purchased from Jawas (A New Hope)
- 0 BBY: Luke Skywalker, inherited from Owen (A New Hope)
Return of the Jedi
- 4 ABY: Jabba the Hutt, gifted by Luke Skywalker (Return of the Jedi)
- 4 ABY: Luke Skywalker, reclaimed after Jabba's death (Return of the Jedi)
After Return of the Jedi
Here the droids split up again, although they frequently reunite over the years.
C-3PO
- 4 ABY: Leia Organa, given to Leia to help her in her diplomatic role in the New Republic. It remained with her family after she married Han Solo and helped raise their kids.
It's not clear what ultimately happened to C-3PO. There is an ambiguously canon Star Wars Tales comic called "Storyteller", set sometime between 45 ABY and 130 ABY, where he is found to be destroyed. He does not appear in any canon material set after 130 ABY.
R2-D2
- Remained with Luke as he founded the Jedi Academy
R2-D2
- Till 130 ABY: Various descendants of Luke Skywalker, culminating with Kol Skywalker
- 130 ABY: The Yuuzhan Vong at the Ossus Academy, who used him to help restore Kol's legacy
- Before 137 ABY: Jedi Master K'Kruhk, who recovered the droid
- 137 ABY: Cade Skywalker, who kept him as part of his crew
I've done my best to note the sources for the major events, but if you're looking for more info, the Wookieepedia Legends pages for R2-D2 and C-3PO list these same events as well, and provides detailed information about the sources.
* The Revenge of the Sith novelization further describes the history of their ownership in the Prequel Trilogy. See this answer for more information.