4K upscaling
When you set your console resolution to 4K UHD, everything on the console—Home, games, and apps—will display at 4K. 4K content is displayed in its native 4K resolution, and other content (like 1080p content) is upscaled to 4K.
To set your resolution and upscale everything to 4K, press the Xbox button to open the guide, go to Settings > All settings, and then choose Display & sound > Video output. For TV resolution, select 4K UHD.
4K in games and apps
You don't have to set your console resolution to 4K to play 4K content. You can set your console to another resolution, such as 1080p, and when a game or app requires 4K (and your TV supports the 4K mode it wants), it'll automatically switch to 4K. This is good if you want to play 1080p content in its native resolution, but also take advantage of the 4K resolution when playing 4K content.
To set your resolution to a lower resolution but switch to 4K when 4K content is played:
Open the guide and go to Settings > All settings > Display & sound > Video output and then make sure TV resolution is set to 720p or 1080p.
Select Advanced video settings and make sure Allow 4K is checked.