bruising can be due to trauma, sexual intercourse, masturbation, sexually transmitted disease, penile injury, skin entrapment in clothing etc. Normally bruising due to non infectious causes would resolve within 8-10 days. Maintaining good genital hygiene, using soft underpants would help. See a urologist if bruising persists after 10 days.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.