The Weighted Companion Cube is a special type of Storage Cube that appears in both Portal and Portal 2. It is identical to the regular Weighted Storage Cube in both games, except that it has a heart where the Aperture Science logo would be.
At the end of the Test Chamber 17 in the original Portal, the player is forced to throw it into an Aperture Science Emergency Intelligence Incinerator. Narrative provided by GLaDOS and Doug Rattmann suggests that the Companion Cube is designed to test emotional stress by having subjects develop affection for it before being forced to destroy it.
In Portal 2, GLaDOS briefly torments Chell by repeatedly destroying Companion Cubes in Test Chamber 7. It is at this point that GLaDOS claims that the Cubes are in fact sentient, which suggests that they possess some level or rudimentary intelligence similar to Turrets.
After Chell leaves the facility upon completing Portal 2, a scorched Companion Cube is ejected after her. This Cube is not the newly-designed Portal 2 Companion Cube, but is the same as the cube from Portal. Valve said that it's the exact same cube the player euthanized in the first Portal, that is given back to the her.