Cube Pokémon is a game is a game mode inside Team Mode, where you can build Statues and Cubes in order to provide the best stats to your pokémon.
There are 6 different statues, each one providing their own Stat (HP, SpDef, Def etc..) up to 10%. You can build a statue using Mysterious Stone and Mysterious Slime, and each statue built will provide 5 random type slots:
There's also a "Kitchen" where you can combine some cakes in order to obtain Pokémon Cubes. These pokémon cubes are the ones being inserted in the Type Slots of the Statues. Each Cube is randomized with one or two stats, according to if the pokémon has double type or not, and the higher the rarity of the cube the higher the stats can be.
The stats of your Cubes are applied to all of the pokémon that share the same type as the cube.
The materials mentioned above to build Statues and Cubes, are obtained in Team Boss Rewards and the Team Shop.
To learn more about this game mode and know a full list of available Cubes, check this video: