Not actually a child of mine, but I worked for years as a nursery nurse so experienced the lot- kinking, headbanging, the lot.
Most of them grew out of it by the time they left the nursery, so 4 or 5, if not a little earlier. Sometimes it takes them a wee bit longer, but I don't really have experience to advise on that one. I think the general concensus is they have usually grown out of it by the time they are around 6.
As long as she is safe and out of dangers way, try not to panic too much- I know it is scary, and I understand that watching it happen to your own child is far more heart wrenching x
If she passes out again during a bout of it, see your GP, talk it over, and they should put your mind at rest a bit if nothing else. Generally the passing out bit doesn't do any real harm.
Good luck x