Certain signals may be required to be displayed by your vessel when it is anchored, to notify other boaters of the status of your boat.
Small vessels are generally obliged to display an all-round white light during the night time. For vessels over approximately 150' or 50m (depending on the jurisdiction) two such lights are mandated. During the day, the requirement is for a spherical "anchor ball" of black color (which creates a silhouette of a circle) which must be positioned forward in a clearly visible location. Night and day are defined as the periods separated by sunset and sunrise.
These navigation rules are fairly standardized internationally, but some exceptions and variations may apply. An anchorage may have a special status. Local regulations and even customs and 'the norm' may have legal implications. The actual status and required signals can also change depending on the vessel's activity even while anchored, e.g. for fishing boats, pilot boats, vessels restricted in ability to maneuver, and others. Small boats, under 7m, when "not in or near a narrow channel, fairway or anchorage, or where other vessels normally navigate", may be excepted entirely.
To be certain as to the required behavior, it is best to consult a local authority on the requirements and local precedents based on these variables. Should another vessel collide with yours while yours is anchored, the signals displayed (or not displayed) may have serious consequences with regard to insurance and the law.