There are three ways that a wolf can detect the player:
When a player enters the line of sight of a wolf, it will move straight into stalking mode, and start to follow the player. Wolves see in a cone shape in front of themselves. Wolves can see a reasonably long distance on a clear day. Blizzards and fog affect the vision of wolves as well as the player.
If a player is out of the wolf’s line of sight, but has something in their inventory which smells, the wolf may detect them, and move into a searching mode. The wolf is not stalking the player yet, but is moving towards where it thinks they are. The more scent markers the player has in the top middle of their HUD, the further the wolf can detect the player from. The wind will also blow your scent towards the wolf.
The wolf may also hear the player moving, and search for them. This effect is multiplied the more equipment the player is carrying, and by the speed of movement (ie. running is louder than walking, and walking is louder than crouching). This usually only happens at reasonably close range, and is often the reason for wolves behind buildings or over ridges approaching the player.