Yes, you lose important information, such as slice position, spacing, axis directions, slice order, coordinate system axis unit. Depending on the chosen format, you also lose image quality (due to compression artifacts) or make the images essentially unusable (8-bit is insufficient for most medical images). You also lose compatibility with most medical imaging software (many of them can import jpg/png image stacks but since there is no standard for storing missing metadata, they all make up the missing information in different ways). You also lose ability to reliably detect missing files.
Even though conversion of medical images into consumer file formats may be tempting (e.g., to run random deep learning example codes that you find on the web), it should be avoided. Instead, you should convert to standard research formats (nrrd, nifti) or directly to numpy arrays.
There are a few exceptions, where conversion to consumer image file formats is appropriate, such as exporting images or movies for creating slides for presentations.