An electrical junction box can be made of either metal or plastic and they are called by a variety of names. This is because they come in various shapes and sizes that are used for different purposes. Boxes like the one above can simply be used to protect the connection of multiple wires and have a flat plate covering it. Electrical boxes like the one on the right are also used for outlets or for wall switches. Other boxes are used for hanging ceiling fixtures and other uses. Some boxes are made specifically for new construction, and others are made for retrofit work. There are many types of electrical junction boxes available, and you can see many of them at any home supply store.
Whether you want a new outlet added to your kitchen, a ceiling fan installed where there is none currently, or a new dedicated circuit added to your garage, a junction box of some kind will be needed. Although there are some handy homeowners who are competent to do this work themselves, for most people we recommend having a licensed electrician do that type of work for you. It can be dangerous at the time you are adding it, and it can be dangerous later if it causes an electrical fire.