Hamsters are rodents, and most rodents make chirping or squeaking noises of some sort. The reasons for these sounds are a little more challenging to figure out, but in hamsters they're often a sign of distress.
A single small chirp or squeak is believed to be your hamster's way of communicating with his friends. However, even hamsters kept alone sometimes make this little sound -- so he might be just trying to greet you.
If your hamster starts squealing loudly when you try to pick him up, he's telling you he's scared. Don't worry though, hamsters can't bite while squealing. The best way to handle this is to gently scoop him up, and hold him calmly in your hands until he stops making noise. Repeat this process daily until your hamster calms down and accepts being picked up without screaming first.
Squeaks that fall somewhere between a single chirp and a sustained squeal usually signify agitation or aggression. Your hamster might squeak a lot when you first bring him home, as he gets used to his new environment. If he's a dwarf hamster, he could squeak while fighting with his cage mate. It's a sign that he's trying to be dominant. In both cases, he likely will settle down and stop making noise once he gets more comfortable with the situation.