M31, NGC457 and IC434 are examples of objects listed in astronomical catalogs. The alphabetic characters are the catalog's designation. 'M' is the Messier Catalog. 'NGC' is the New General Catalog and 'IC' refers to the Index Catalogs which are addendums to the New General Catalog. The numeric portion is the object's entry number in the catalog. M31 then refers to the thirty-first object in the Messier catalog. Those are just three examples of catalogs, there are many others, each with their own alphabetic designation. However, these three catalogs are the ones you'll encounter the most in amateur astronomy.
The Messier catalog was created by Charles Messier in the seventeenth century. It was the first attempt to list deep sky objects. Messier was a comet hunter, and he didn't want to waste time observing these objects to see if they moved relative to the background stars as a comet would. The objects in this catalog are all visible from the northern hemisphere and are big and bright enough to be seen with most amateur equipment, though some of the objects do need dark skies. If you're new to the hobby and are wanting a list of things to view, start with the entries in the Messier catalog.
The New General Catalog and the Index Catalogs were compiled by John Deyer near the end of the nineteenth century and the beginning of the twentieth century. Together these catalogs contain over thirteen thousand deep sky objects found in both the northern and southern hemisphere skies. Many of the objects in these catalogs were discovered by William, Carolyn and John Herschel. In the 1980's the Ancient City Astronomy Club in St. Augustine, Florida complied the Herschel 400 comprised of the best 400 deep sky objects from the NGC and IC catalogs. When an amateur astronomer is looking for a new challenge beyond the Messier Catalog, they often turn to the Herschel 400.
Many popular deep sky objects have nicknames. These nicknames often are chosen to describe the object. The Ring Nebula looks like a ring. These nicknames aren't standardized. Some objects have multiple nicknames. Messier 17 is called The Swan Nebula, the Omega Nebula and sometimes the Checkmark nebula. Once a buddy asked me to point my telescope at the Apple-core nebula. It turns out he was referring to Messier 27, more commonly called the Dumbbell nebula. While growing up, my buddy spent a lot of time stargazing with his grandfather. His grandfather thought that 'Dumbbell' was a derogatory term and preferred to call M27 the Apple-core nebula so that's what my friend had always known it to be called.
Sometimes the same nickname is used for different objects. The Messier galaxy M33 in Triangulum and the Messier galaxy M101 in Ursa Major both are often referred to as the Pinwheel galaxy. By using the common catalog designations of deep sky object these kinds of ambiguities can be reduced; not totally eliminated though, because many objects are often listed in more than one catalog.
I don't think anyone really learns the name of objects until they observe them: selecting a target, planning the observing session, hunting it down in the night sky, and the satisfaction of finding it and observing it. It helps to jot down notes about your observations. The notes can be as simple as writing down the date, the object's name, and a brief note about its appearance. When you do that these objects become like old friends, and their designations, nicknames and catalog numbers, just become second nature. It's the difference between reading the reviews of a movie, and actually watching it. So get out there and observe.