Stamps in the original game were used to decorate Miiverse posts, until the service was discontinued in 2017. Since then, the stamps lost their function, but you can still collect them. In the Switch port, Stamps have been colored in and are integrated into the Snapshot Mode as decorative wall pieces.
There are a total of 85 of them throughout the game, and are found in almost every world, except for World Mushroom and World Flower. They can be found in normal courses, Castle Courses, and in Sprixie Houses.
To unlock the twelfth and final World, World Crown, one must collect all three main collectibles of the game from the previous eleven Worlds, with 76 Stamps being needed to help unlock World Crown, which contain 4 more Stamps to round out to 80.
The last five stamps of the game, those being Mario, Luigi, Peach, Toad, and Rosalina's Super Mario 3D World character portraits, are collected by completing every single level with the character that the stamp accords to, including Blockades, Mystery Houses, and World Crown levels; the sole exception being Captain Toad Courses, as you don’t play any of the characters in these modes.
Once you clear a stage with all 5 characters, the Green Star on a course's overworld flag becomes gold, with exception to normal Blockades, who don't have flags in the first place. When you clear all playable stages with every characters in a particular World, there will be a cat paw print added to that World's Progress sheet, to the upper right of the Stamp column.