At what Tanner stage is the foreskin fully retractable?
For most boys, the foreskin is attached to the glans at birth and by the age of five it is detached from the glans. It should not be forceably detached during these early years as it could damaged the glans.
For those boys whose foreskin does not detach by age 5, it should definitely detach when they begin having erections in stage 2. Anytime after age 5, the foreskin can be gently encouraged to detach by stretching the foreskin away from the body. See: See: The skin on my penis doesn't pull back all the way to release the tip of the penis.
For some boys, the foreskin does detach, but they were never taught to properly care for their penis. They never realize that their foreskin can slide back or that they are supposed to wash underneath the foreskin. Over time smegma builds up and "glues" the foreskin to the glans. The solution is the same as a non-detached foreskin. See: When I pull my foreskin down on the head is a bunch of white stuff. What is it and how do you clean it?