In the days of film aspect ratios were fixed by the camera and film format; while this is true of some digital cameras, newer ones allow you to choose from a few aspect ratios to shoot in. Add to this the fact that we have easy, infinite control over cropping during post-processing and aspect ratios become another factor in the creative choices we can make when creating images. The article linked below looks at some common formats and explains why we might choose them.
Aspect Ratio: What it is and Why it Matters
I see many newer photographers asking in forums, whether they have to use one of the common or standard formats. The answer is no, you can and should embrace free-format cropping that lets you make the crop that best suits an image. Sometimes images even lend themselves to different crops; you might find that you want to create several different versions of the image and that’s fine too.