An anchor light is a light displayed by a ship at anchor. Anchor lights are required by law in many settings, and strongly recommended in others, because they are an important part of the safety systems used to ensure that sailors are aware of the location of boats, and know what those boats are doing, even in poor visibility. Many stores which stock sailing supplies and equipment carry anchor lights, and such lights are also typically installed on ships and boats when they are manufactured.
The anchor light must be bright white, acting as a signal to other boats that the boat is at anchor, and not underway. The white light also acts as an alert that the boat is not in trouble; it's simply stopped for the time being. Laws require that anchor lights be highly visible so that they can be seen across a long distance, requiring very bright bulbs and well maintained lights which are not allowed to get dirty, as this might obscure the visibility and color.
Anchor lights are used for the safety of the boat. Boats which are underway can see the anchor light and adjust their path, if necessary, to avoid a collision. This is especially important with large craft such as tanker ships, which often have trouble seeing small boats. This is also why visibility is important, as a big boat can take a long time to change course for the purpose of avoiding another vessel.
In areas where people commonly anchor and sleep in their boats, fatalities can occur as often as annually as a result of not using anchor lights. In these regions, collisions happen because people neglect their anchor lights, and the occupants of a boat may drown or be injured when their boats sink or are damaged by a crash. This is why many sailors recommend using an anchor light even when it is not specifically required, because one never knows when another boat might go by.
Using an anchor light is only one among several marine lighting requirements. All of these requirements are designed to universalize the indicator lights used on boats and ships so that people instantly understand what they mean. For example, port and starboard running lights are kept consistent so that people can see that a ship is approaching or receding, and they can tell which direction the ship is coming from based on the configuration of the lights.