I'm not sure if this was changed since last time I checked, but from what I remember:
When, in war, you conquer a city, you gain warmonger penalty, and the city becomes occupied.
During peace negotiations, if you return the occupied city, the penalty from having conquered it is removed. If, instead, you keep the city, the warmonger penalty is doubled, but the city becomes yours is no longer occupied (so it can grow and produce like other cities).
This might have changes since then, though...