Adding header function to theme

This code adds theme support for custom headers which adds a new page under Appearance in the wp dashboard.

function themes_custom_header_setup() {

add_theme_support( 'custom-header', $defaults, array(
    'default-text-color'     => 'fff',
    'width'                  => 1260,
    'height'                 => 240,
    'flex-height'            => true,
    'wp-head-callback'       => 'themes_header_style',
    'admin-head-callback'    => 'themes_admin_header_style',
    'admin-preview-callback' => 'themes_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'themes_custom_header_setup' );

You can add/remove default arguments in the above code.

Source http://codex.wordpress.org/Function_Reference/add_theme_support

Then you can look in the header.php file of a theme like Twenty Fourteen to see how its coded.