When? Between the end of the Roman Empire up until the Unity of Italy, the Papacy exerted enormous political and social control in the running of the city, and between the ninth and nineteenth century outright managed a large Central Italian polity. And even after Italian Unification, the Papacy continued to be indirectly influential in both national and local politics, both in Italy as elsewhere. The non-recognition of the unified Italian state by the papacy would be one of many contentious political topics up until the conclusion of the Lateran Treaty of 1929, while in the early postwar era the Papacy and the Catholic Church would even grow in influence (at least in Italy) through their close relationship with the long-ruling Christian Democracy Party. Increased secularism in a modernizing and liberalizing society would reduce the role and influence of the Church starting from the 1980s (as would the fall of the Christian Democracy Party in the early 1990s) but the Papacy continues to be a tangible presence in Rome, just as Catholicism continues to be an important underpinning of society.
If you have a specific time period or kind of influence in mind I'd be more than happy to elaborate, if it's a topic I'm familiar with.