DaVinci Resolve is available in two versions - the free "lite" version and the paid for version. The Lite version will support projects at up to Ultra HD resolution - 3840x2160. The full version will support full 4K.
Resolve will load many types of 4K footage but works best with the "less compressed" versions. So, for example, although it will load footage filmed with the Panasonic GH4 it will struggle to play it back properly. Like most programs Resolve does not like the MP4 files created by the GH4, refusing to even load the audio section of a clip, but will work with the MOV files.
Resolve works better with files from the Blackmagic Production 4K camera and tends to play these files back better than all the other programs. It is also one of the few files which will load the DNG files that you can film with most of Blackmagic's cameras. This is hardly surprising since Resolve is also owned by Blackmagic.
Resolve will output either uncompressed or H.264 compressed MOV files at 4K although will not make other kinds of files. The range of output formats does not improve if you buy the software as opposed to using the free version since the paid version basically adds higher than UDH support, better acceleration with multiple graphic cards and extra noise reduction.
Resolve will output 4K using Blackmagic's own hardware, which is also the cheapest hardware available to output 4K footage.