Mary I had to do a lot of searching to figure out where this book was set as well! Strange that it is described in such detail, but not actually named (or it may be at some point, but certainly not prominently)!
Oliver Klein It takes place in the Caribbean coast of Colombia. There are a lot of references such as Rioacha, Mompox, Cartagena, Cieneaga, Valledupar. He also mentions that Florentino is working in Villa de Leyva, which is a city in the Boyaca province in Colombia.
Carole Others have said South America, but the narrator talks about the place being in the Caribbean and calls the exact location "the colonies" suggesting it is a Caribbean island that was colonized by the Spanish and later inhabited by the English. All the references to black people would suggest that this was a Caribbean island country. I've read in different places that Marquez made up the locale.
Doug If you follow all of the references it most closely matches Barranquilla, a bit up the coast from Cartagena, (They are on the Caribbean). Most compelling aspect for that is it being at the mouth of the Magdalena. However, he is not consistent and it seems to have some aspects that better match Cartagena (Cartagena had a much longer colonial history; Barranquilla dates to early 19th century.) So probably an imaginative amalgamation of the two. Most of the other geography somewhat makes sense--mountains are Sierra Nevada del Santa Marta and the towns where her relatives lives are pretty much where he describes. Geography along the Magdalena also checks out.
Rodrigo Gabriel García Márquez was born in Colombia, and his own country was the setting that inspired him the most. He speaks of many Colombian cities, and we also get hints of when the novel takes place: he speaks many times of the "turn of the century" (around 1900) and also the technological developments he mentions: hot air balloons, automobiles, typewriters, can help us get an idea of the time. Also the clothes description, for those who know more about that.
Judy Location and date were not clear at all. About half way through the book, it mentions that Rafael Nunez was president. So I googled it to discover he was president of Columbia from 1880 - 1884. When cities were mentioned, the author certainly could have add the country too. I picked up Caribbean, but it needed to be more specific. There's many countries in the Caribbean.
Gerald Ross Seems to me it is a mix of Cartagena and Barranquilla, both port cities in Colombia. The descriptors of the working class areas and the docks seem to align more with Bucaramanga than Cartagena