Sounds like you might have dislocated it. You might want to ask an orthopedist. The more often it pops out, the easier it pops out the next time.
Yeah I recommend seeing a dr and having it looked at. Knee injuries can be tricky.
I would get it checked out, too. It may be nothing, but you don't want to miss anything serious, either. It may be a ligament or something.
You need an evaluation as soon as possible. The liklihood is that you will be prescribed a knee support, perhaps a circumferental wrap, and restrictions placed on exercise. At least for a while. An MRI is probably indicated, but insurance may give you a hard time. Check with your parents and see if an ER visit is covered and if so, head to the ER, even if you miss a day of school. You really have to know exactly what is going on to properly plan your school and recreational activities.