Change header style when users sign in I am using the default template and I want the background color of the header change when a user signs in. 

I know I will need to write a simple if statement like if (user_is_logged_in()) { } somewhere, but I don't know where to place it.
Look at the body tag of your theme. Some themes add classes to it indicating whether or not you are logged in.  If yours does, then you can do this via css by:

.logged-in #header
{
   background-color: #fff;
}

.not-logged-in #header
{
   background-color: #000;
}


If you don't have a body class that indicates logged in status, then you modify your page.tpl as user4035 suggested. There is no is_user_logged_in function.  Instead, it's 

&lt;?php
global $user;

if ( $user-&gt;uid ) {
  // Logged in user
}
else {
  // Not logged in
}
?&gt;


Code Source - https://drupal.org/node/92218#comment-167984