anhalten - to stop (a car or a machine)
Ich mußte mehrmals anhalten, um nach dem Weg zu fragen. - I had to stop (the car) several times to ask for directions.
Er hat mich auf der Straße angehalten, um nach dem Weg zu fragen. - He stopped me in the street to ask for directions.
There are also several other meanings, usually with a certain construction, e.g. "um jemandes Hand anhalten" to propose marriage; "jemanden dazu anhalten, etwas zu tun" to strongly encourage somebody to do something
aufhalten - to keep, as in "Ich will Dich nicht aufhalten, Du hast sicher zu tun" (I don't want to keep you, you're probably busy); to take rather a long time doing something, e.g. "Ich mußte erst den Herd putzen, ehe ich den Kuchen backen konnte, das hat mich aufgehalten" (I had to clean the stove first, before I could bake the cake, that took me a while/that's what kept me)
These verbs could sort of cross over, e.g. if X stops you in the supermarket to tell you a long story, then you might say "X hat mich aufgehalten", i.e. by stopping me, he also kept me from getting back earlier/doing whatever else I was supposed to do instead.