Fluffy was used as the first line of defense aganist potentional thevives of the philosopher's stone. As his name suggests, Fluffy belongs to Hagrid, who got him from Greek person he met in a pub. The only way to get past Fluffy is to play him music, but Fluffy wakes up the moment the music stops playing. Professor Quirrell got past Fluffy by playing a harp. Harry, Ron and Hermione used a flute that had been given to Harry by Hagrid.
Fluffy is based Cerberus, a three-headed dog from Greek Mythology, hence the reason that Hagrid got Fluffy from a Greek person. Like with Fluffy, Cerberus was musiced to sleep, though this more a testment to Orpheus' music skills rather than suseptibilty of Cerberus. Note in the film Hagrid said he got Fluffy from an Irish person instead of Greek. This is a mistake. Steve Kloves says when he wrote the script it said "Greek," but was changed somewhere along the line.
J. K. Rowling was asked in an interview what happened to Fluffy after he was no longer needed to protect the Stone. She said Fluffy was released into the Forbidden Forest.