When dd was about 3.5, I think - although I did it in a very low-key way, just making sure that she knew not to go anywhere without me, even if someone else said it was OK.
I haven't really felt the need to make a big thing about "stranger danger" really.