Anywhere from 2 days to 2 weeks.
If it is an STD how long do those symptoms take to appear after the time of infection?
Could be a non-STD UTI although those are uncommon in men under 40.
If it is an STD you could not have contracted it without sexual contact.
I suggest that you see your doctor and get tested for gonorrhea, chlamydia, and NGU.