it sounds like you have arthritis. synovial fluid lines the joints and prevents friction when the bone joints move. when you have arthritis, some of the cartilage is worn, so some areas have bone to bone contact and little cushioning until the body starts circulating the fluid. when that happens, the pain disappears.
on another hand, if you had a sprain or soft tissue injury in the past, you can have the same results.
tissue heals by scarring, thus rendering the ligaments/tendons more inflexible. when you intially stand, the tissue has to stretch. since it's inflexible from the prior injury, the stretching hurts. once the body starts moving more, the tissue assumes the length needed to accommodate walking/running and the pain dissappears.