What print quality / resolution is needed for barcode printing?

This depends on the barcode type. For linear barcodes the print resolution should not be under 150 dpi. With Code EAN / UPC and their derivates or high density codes, e.g. Code 39 High Density or Code 2/5 High Density, the print resolution should not be under 300 dpi. With 2D symbologies like QR a resolution of 72dpi (i.e. screen resolution) will usually work.

Generally speaking, the smaller the code dimensions the higher the resolution to ensure a scanable barcode.

Regarding the print quality, you will get best results with dedicated label printers (thermal transfer or thermal direct) and laser printers. If you are using an ink printer make sure that you print on dedicated ink paper. Dot matrix printers are not recommended for barcode printing.