Traditional stucco is a mixture of sand, Portland cement and hydrated lime. It is often used to create a durable exterior wall covering. You can nail into traditional stucco using masonry nails, which are thicker than wood nails and have groves or flutes that allow them to grab into the masonry material. More recently, a synthetic form of stucco has been used called Exterior Insulation Finishing System or EIFS. This stucco is created using a base layer of foam insulation and an acrylic-based mixture that simulates stucco. You should not nail into the EIFS type of stucco without consulting the manufacturer's instructions or it could affect your warranty.

...
Use masonry nails to add wood trim to stucco walls.

Step 1

Mark the stucco surface with a pencil in the selected spot where you plan to nail. If the texture is rough, use a lumber crayon in place of a pencil to make a more visible mark.

Step 2

Center the masonry nail head on the mark on the stucco surface. Hit the head of the nail with a hand-drilling hammer to drive it into the stucco. A hammering drill is meant for heavy-duty work and will withstand the hardness of the masonry better than a wood-framing hammer.

Step 3

Drive the nail into the surface of the stucco to the desired depth with the hammering drill. For hanging decorations, you will want the nail head to project from the surface slightly.