While that is an ‘easy’ way to do it, it is not necessarily the best way.
Depending on what theme you use (for instance if you use a WordPress default theme like 2010, 2011, etc), the theme may be upgraded in the future with a new WordPress version. Your changes would be deleted.
Also if you use another theme that is well supported and receives updates, when the theme is updated, your changes would be lost.
Or maybe in 2 years you decide you want to upgrade your site, you switch themes forgetting that line of code you added to header.php and again – your changes are lost.
The technique @ipstenu suggested is one solution that is theme independent. I personally use a plugin (There are many – I use WordPress SEO) to verify my site. A plugin is also theme independent. Doing your verification in one of these manners keeps you from losing your verification upon theme switch or upgrade