The behavior your daughter is displaying is most likely a form of self-soothing to reduce tension she may be experiencing such as boredom or frustration. Children at this age also like to explore their world, and this includes their bodies.
The stage she is at developmentally is one of improved motor skills, which would include her ability to pinch and grasp small objects like hair. This may be increasing her curiosity about what she is newly able to do.
Offer some alternative options for soothing and exploration such as a favorite blanket or stuffed toy or an object that can be safely played with in her crib. Also talk to her pediatrician about some recommendations for how to best handle this behavior.