You need to make sure it's a open area. Make a simple house, then when you have more materials, expand the house. Every room you make must have a chair, table, and a light source. As you expand your house and get more coins and items, NPC's will appear.
http://terraria.wikia.com/wiki/NPC