This could be many different things. One things that comes to mind is penile melanosis, which is harmless. https://www.healthline.com/health/penile-melanosis
Another is angiokeratoma - https://www.healthline.com/health/angiokeratoma This is also usually harmless. Some people just get one or two of these, others get many.
How long have you had it?
Obviously, the only way to know for sure is to get it checked. It could be a melanoma, although that's unlikely, so don't put it off. Let us know what the doctor says.