Use PNG when the picture is a graphic: type, logos, screenshots of UI, anything with a transparent edge. JPEG will smear letters and invent a background.
Use JPEG when the picture is a photo or a busy screenshot you need to email. The file will be smaller. You will lose alpha and some fine detail.
This site always writes PNG. The sibling webp-jpg.com always writes JPEG. webptools.com lets you pick either on one page.