Vertically printed threaded bolts generally work better than you might expect, because (1) the layers are nearly parallel to the direction in which they have to slide, so the bolt can turn smoothly, and (2) when a typical bolt is sliced, the resulting layers are just circles, which are about the least problematic shape you could print.
Also note that, especially if you're printing a bolt to use with a metal nut (or vice versa), then as long as the thread is close enough, it will end up being crushed / sheared into the right profile; it's a bit like how you can drive a screw into timber without having to tap a thread.
In principle, the pitch of a printed bolt could be very fine; as long as the layer height is less than half the pitch (i.e. the Nyquist limit), and the spacing is correct, then the threads will engage. So if you can print 0.1mm layers, you have enough detail for M1 or smaller. Of course you're not going to print a bolt that small, but the point is, the limit is not resolution, it's the strength of the print.
The horizontally-printed bolt in @R.. GitHub STOP HELPING ICE
's answer is impressive – if you can print that, then that's the answer. But even if you can't, you could definitely print a horizontal 3mm diameter cylinder, and then use a die to cut the thread on the finished part. It's not a "pure" printed solution, but you can get a cheap tap-and-die set from any auto parts store for less than the cost of a spool of filament.