Compare the point you actually gain
A settlement is worth one point. A city is worth two in total, replacing a one-point settlement, so the upgrade adds one point rather than two. Three ore and two grain pay for the city; wood, brick, wool and grain pay for the settlement.
The settlement price can be misleading if you need roads first. Two roads plus a settlement cost three wood, three brick, one wool and one grain. Include that access cost before calling expansion the cheaper option.
Upgrade your best working corner
A city doubles the normal production of its existing settlement. Upgrading a corner that regularly provides the resources you use can improve later turns without needing a race for new land.
It also concentrates more value in the same tiles and numbers. A robber on your main ore tile hurts more when you rely on a city there. A new settlement can spread production to different numbers or cover a missing resource instead.
Consider which opportunity can disappear
An open settlement site can be taken or blocked by an opponent. Your own settlement usually remains available to upgrade later, subject to resources and the four-city limit. When a strong site is contested, expansion may be the urgent move.
The reverse can also be true: if the board is crowded and your road route has little chance of reaching a legal site, a city uses the space you already secured. Do not keep paying for a race you have effectively lost.
Choose for your next two turns
If you hold three ore and two grain beside a productive settlement, a city is available now. Trading away most of that hand for roads delays both the point and the extra production; the destination must justify that delay.
If you instead hold the settlement cards and already have a road at a scarce grain corner, take the useful expansion seriously. There is no universal build order: compare present resources, production quality and the opportunity cost of waiting.