Note that I'm using "country" in the sense of a larger geographic entity that people identify with. That may not be appropriate for the early 18th century, even in places like, say, France (which look quite modern on a map).
It seems like much of the Holy Roman Empire after the Peace of Westphalia devolved into little more than city-states outside of what became Austria and places like Bavaria.
How did people living in cities in what is now Germany think of themselves? Did they see their cities as part of the Holy Roman Empire? Or was that institution so pointless by the early 18th century that it didn't mean anything to anyone, especially as far as broader geographic identities were concerned?
Contrary to popular perception, the Holy Roman Empire did not disintegrate, or disappear from public consideration, after the Peace of Westphalia. It already was a large collection of different entities - from the larger kingdoms to the smaller free cities, prince-bishoprics, imperial knights and principalities, all owing fealty to the Emperor and expecting imperial protection in return. You can think of this as a slightly different direction of travel to that taken by initially similar kingdoms in Western Europe, with a tendency toward fragmentation rather than consolidation of power.
The Peace of Westphalia undermined imperial power because it guaranteed confessional self-determination to Protestant polities - a slap in the face to the Catholic Emperor who had spent the Thirty Years War trying to crack down on Protestantism in the empire. But it didn't bring an end to imperial legitimacy or the empire itself, which continued to evolve to meet the changing circumstances.
Two events brought an end to the legitimacy of the empire: firstly, the rise of Prussia as a power capable of contesting Austrian hegemony within the empire, with its own sphere of influence (ironically the Prussian leaders themselves still largely respected imperial rule until around the 1840s, even while sometimes fighting political quarrels with the empire); and secondly, the emperor's own abandonment of his traditional duties when defeated by Napoleon. Napoleon annexed increasingly large tracts of imperial territory for either France or French allies/puppets, and the emperor compensated the previous owners of that territory with land seized from small players like the free cities. This completely undermined the role of the emperor, who was supposed to be the protector of the free cities, and paved the way for the Holy Roman Empire's formal dissolution.
So to answer your question: in 1725 someone from Stuttgart would be a subject of the Duchy of Württemburg, whereas Cologne and Frankfurt were imperial free cities. All would be subjects of the Holy Roman Empire. I think it is also probable that they would have considered themselves to be Germans - though German nationalism was not yet a political force at this time.
Source: "Iron Kingdom: The Rise and Downfall of Prussia 1600-1947" by Christopher Clark.