Visits occur when an NPC villager asks to come to the player's house or requests that the player come to theirs. These requests will occur occasionally and can be accepted or declined. If the request is accepted, the villager may want the visit to happen right away or ask the player for a time to meet.
If a villager wants to visit a player's house, the player must be inside their own house at the time that the villager is supposed to arrive. The visitor will arrive within a few seconds to a minute. If the player is going to a villager's house, then the player must go into the host's house at the proper time. Nothing much happens during a visit; the villager will just walk around the house. The villager will make comments on the player's house or tell the player about their house, possibly offering the player a piece of furniture.
A villager visiting a player's house will take their leave after being there for around 5 minutes, longer if the house has multiple rooms. When the visitor wants to see a different room, they will say "Hey! So can I check out every room?", "What are the other rooms like?", etc. However, if the player lingers in a single room for too long, the visiting animal will leave after a while even if they have not seen every room. Players can leave a host villager's house by simply walking out the door, which makes the villager ask the player what they think of the host's room. If an animal is visiting the player's house, the player can cut the visit short by walking out the door. After a visit has passed, the player will receive a letter the next day from the villager, thanking the player for coming over or having the villager over. A present will be attached to these letters.
If the player is not inside their house at the time a villager is supposed to visit, the visit will be canceled. If the respective villager is talked to after that, they will be disappointed and will possibly get angry. This conversation can be avoided by not talking to that certain animal for the rest of the day. Occasionally, although apparently rather uncommon, a villager who is supposed to visit a player's house will not show up. If that villager is talked to after that, they will apologize and give an excuse. A similar situation can occur when the player is supposed to visit a villager's house, but the host was absent.
A visit to a player's house can be "innocently" avoided by just closing the DS while the player is inside their house. If the player opens the DS again a while after the visit was scheduled, the visitor will not show up. This will not trigger an angry response from the one who was supposed to visit, but rather an apology for not showing up on time.
In New Leaf, on occasion, a villager might stop by a player's house for no real reason, even if no visit was scheduled. The visiting animal might give a present to the player, normally being furniture. These small visits last for a shorter time than a scheduled meeting. The visitor also will not follow the player into other rooms as they would if it were a normal meeting. Also, in the 2.0 New Horizons update, it is hinted that villagers can invite players to their houses, and may occasionally stop by the player's house for no reason.