After playing basketball I just start getting knee pain or pain in thighs so why I would be getting this?

Not Sure. Additional information is needed. It could be an issue of stretching, warm up, out of shape, the way the knee cap moves on the knee, particular moves or plays, foot/ankle/hip problems, etc. If the pain continues, you should have it evaluated. If it is once or twice, treat it like any other acute sports injury.
How old are you... This could be different things depending on your age. Arthritis, plain old muscle soreness, or other knee injuries are possible. If it persists you should get evaluated by your doctor.

Related Questions

Was playing basketball and over extended my leg and then felt some pain in the back of my knee. Pain is more in the back upper calf area. No swelling.

Strain. The beginning of the calf muscles, the end of the hamstring tendons, the joint capsule and the menisci are possible sources of pain in the back on the knee. Swelling inside the joint would suggest a meniscus tear, and thus, it's a good sign, you don't have swelling. Ice and rest for next 3-5 days. If pain, persists, then see an orthopedic physician. Read more...
Hamstring Strain. A strain is a tear of muscle fibers. The hamstring muscle group inserts behind the knee. Athletes who sustain hamstring injuries report pain in the posterior thigh and a pop while engaged in speed, cutting and accelerative sports. Hamstring strains are often partial tears of the biceps femoris long head. You describe eccentric hyperextension. I urge you to seek UC and use RICE, crutches, NSAIDs. Read more...
Torn Gastrocnemius . You may have torn your gastrocnemius muscle Maybe the medial head. You need to see your physician and a specialist to get the correct diagnosis. Read more...