The answer to this questions kind of depends on the technology you are using.
(X)HTML 4 and below will only allow you to use one h1 per page - so it's got to be the most important thing on that page. Think of it like the headline on the front of a newspaper. Your H2 elements are then the sub-heads, h3's sub-subheads and so on; like the newspaper you can have as many of those breaking up the text as you want. This is why you may have heard about people using an h2 element for their main headline, especially on home pages; the most "important" thing there - to the client at least - is the logo, which is therefore often wrapped in an h1.
HTML5, on the other hand, lets you have multiple h1 elements (one per section). So you can wrap your logo - up in the header - in one, you can have one for your page's main headline - it's in a
or- and your sidebar can have one - it's in its own <sidebar>after all. You can even have one in your footer if the whim takes you. Search engines establish which h1 is more important through a hierarchy (article is more important than sidebar is more important than header or footer).
Hope that helps!</sidebar>