From the Super Mario Wiki
Stretch Blocks are blocks composed of five segments which constantly extend and retract vertically or horizontally, in some cases alternating between the two. They first appear in Super Mario World, where they serve as bridges in certain levels, and are made up of blocks that resemble pale-colored versions of Rotating Blocks.
Stretch Blocks also appear in two World-e levels in Super Mario Advance 4: Super Mario Bros. 3: Slip Slidin' Away and Rich with Ropes. In this game, they actually use the same yellow color as regular Rotating Blocks from Super Mario World.
Stretch Blocks make their latest appearance in New Super Mario Bros. U in Rock-Candy Mines as an integral part of navigating the world; they are color-coded red and blue, and will extend or retract depending on which colored switch is hit. They also appear in some levels with their New Super Mario Bros. Wii appearance. This time, however, they blink just before they stretch or retract.
Stretch Blocks appear in Super Smash Bros. for Wii U and Super Smash Bros. Ultimate on the Mushroom Kingdom U stage. They have the same appearance as in New Super Mario Bros. Wii and New Super Mario Bros. U. Stretch Blocks appear in the Acorn Plains section of the stage.
Names in other languages