The JPEG was created in 1992 by the Joint Photography Expert Group which is also where the name comes from. Their goal was to take a large photographic file and condense it so it could be shared easier. This allows you to create smaller files than you can with a PNG. JPEGs or JPGs are great to use when you have an image that takes up the entire bounding box and doesn’t need to be a super high-quality image.
The PNG was created in the mid 1990s and was created to replace the GIF file type. One of the biggest benefits of using a PNG over a JPEG is that they allow a transparent background. A PNG file is usually larger than a JPEG, but also contains a lot more background information that the JPEG doesn’t keep.
There is a time and a place to use each of these different file types. When I create logos for clients I send them both of these file types. Below are examples of when you should use one file over the other.
As you can see in the images above, the JPEG has a bounding box and the PNG file does not. More often than not, when I am working with logos, I use a PNG. It allows me more freedom to create, and not have to worry about dealing with the attached background. The transparent background allows me to work with a lot more background options. However, if you place a shape behind the logo, it will be there because the PNG does not get rid of any information when it is created, whereas the JPEG condenses the information it uses, which also gives it a background (white).
When you are dealing with an image that fills the entire bounding box, most of the time I use a JPEG. The JPEG will allow the image size to be smaller, and you don't have to worry about the transparent background because the entire area has an image covering it. If you are using images for a website, I would highly recommend using a JPEG when it fills the entire area because the smaller file allows your site to run quicker and smoother.