To know whether it will heal by itself or need treatment depends on the cause of knee lock. The various causes of knee locking are torn medial meniscus, mis-aligned knee cap, osteoarthritis, knee arthritis, torn lateral meniscus, osteochondritis dissecans, recurrent patella dislocation - may cause knee locking or knee collapse, chondromalacia patella - occasional locking or knee collapse, knee alignment problem, knee fragment or knee cartilage disorder. True knee locking is caused by either a torn piece of cartilage, or a loose bone fragment due to a bone disorder called osteochondritis dissecans. Sometimes misalignment of the bones and muscles around the knee cause this obstruction. True locking is fairly rare. A person can experience an inability to move the knee after an injury which feels like a locking of the knee. However, this is not due to something physically interfering with the movement of that knee. This is called a pseudo-lock.
Hence you may need X-rays and MRIs of the knee to find the exact cause. If you use your knee a lot, then its best you consult a specialist.
Please consult your PCP for primary examination followed by proper referral.