Hacker has several common meanings, the unifying characteristic of which is only that it refers to a person who is an avid computer enthusiast.

It is most commonly used as a pejorative by the mass media to refer to a person who engages in illegal computer trespass remotely via some sort of communications network (e.g., the Internet, a LAN or a dial-up network); its original meaning referred to an unauthorized user of the telephone company network (now called a Phreaker) but it can also refer to people engaged in ethical computer hacking (e.g., debugging or fixing security problems), to the members of the open source and free software community, or to home computer hobbyists.

Read more here.