I had a hip replacement a year ago.
I took it very carefully for the first 4 months - no running, stuck strictly to my exercise program etc. After 4 months my doctor signed me off and we had a chat about running. Basically, running is likely to shorten the life of your new hip and therefore they cannot recommend it. However, you as an individual need to balance the effect on your personal wellbeing of not running with the fact that you are shortening the life of your hip. The health professionals would rather you found something with less impact to do.
I can't imagine not running- so I do. I know that I am probably knocking time off the life of my hip, but if it is a choice between running for 20 years or walking for 25 I choose to run.
However, that doesn't mean I go silly about it. I try to listen to my body.
My first run was just after 4 months after my op. It was a parkrun 5K. I walked the first 1K, then moved to a very slow jog. The plan was to do maybe 500m before walking again, but I found that I just kept going at a slow jog.
For the next couple of months I kept it to no more than 4 miles and on grass where possible. A couple more months, up to 6 or 7 miles. Just over 1 year after the op, I did a half marathon (last weekend). I know now that was my limit. For the first time I was properly aching afterwards, so I will do 1 HM per year, but nothing longer.
And, for the record, my fastest post-op 5K is only 10 seconds slower than my best pre-op and my HM is an official PB.