Summary:

While at war, you can offer to negotiate peace through the Diplomacy Panel. Your opponent may refuse to negotiate altogether, in which case the war will continue.

If it's willing to negotiate at all, a city-state will always accept an offer of peace without pre-conditions.

If your opponent is a civilization who is willing to discuss peace, you may negotiate the price for peace on the Trade Table. Depending upon circumstances one side or the other may give the opponent gold, treaties, cities, and/or resources in exchange for peace.

Note that your opponent can also offer to negotiate peace. It's usually a good idea to at least see what they're offering before deciding upon your response.