Slightly literary/nostalgic. In modern speech almost always refers to Beijing (北京). In historical novels and period dramas it refers to whichever dynasty's capital — Chang'an, Kaifeng, Nanjing, etc. Neutral modern equivalent: 首都 (shǒudū).
culture
Common in set phrases and idioms such as 名震京城 (famous throughout the capital) and 京城名医 (renowned capital doctor). Often carries a faint whiff of imperial-era grandeur.