It depends on the size of the deck, but typically it would take a few days. The deck is built by first framing out the shape of the deck with treated lumber. The joists are then installed, followed by the decking boards. The railing is then installed last.
It depends on the size of the deck and the type of material used. A simple deck can be built in a day, while a more complicated one might take several days. Decks are typically built with either wood or composite lumber. Wood is usually cheaper, but requires more maintenance. Composite lumber is more expensive, but doesn't need to be stained or sealed and is more resistant to weathering.