How many days to spend in Azerbaijan?
A full day is really all you need to see Baku. As far as Baku itself is concerned, the Old City (namely, the mysterious Maiden Tower and the epic Palace of the Shirvanshahs) and the Flame Towers (which are visible from, well, everywhere, and don’t really merit a dedicated visit) are really the only game in town, save maybe for taking a sunset stroll along Baku Boulevard. Obviously that would be omitting museums, but if you are not big fan of them then 1 day will give you a good overview of Baku city.
Outside of central Baku there are mud volcanoes, “James Bond” oil fields and a couple of naturally-occurring “eternal” flames. Seeing all three of those plus Baku’s city attractions requires at least two full days, to say nothing of how long it might take to experience Azerbaijan as a whole. If you have more time then plan 1 extra day for overnight trip to Sheki at the footsteps of Caucasus mountains. Trip to Xynalig village is very scenic in the summer time, but will also take you a full day at least.