Why do I have hip pain after sitting a while then standing? Also when laying down sleeping?

See Orthopaedic Surgeon. There is a long list of things that could be causing your hip pain, including referred symptoms from other locations. If your pain is significant and persistent then I would seek consultation from a local orthopaedic surgeon.
Let me explain. Pain and stiffness of the joints can also occur after long periods of inactivity (for example, sitting in a theater). This one the major sign of what we call degenerative arthritis.