The game takes place in 1987, around the time FNaF 2 takes place. From what can be seen from the calendar, the game takes place from November 16th, 1987, to November 20th, 1987. The 6th and Custom Nights then take place on November 21st and 22nd. You play as Mary Schmidt, who was also a worker at the robot factory The current lineup of animatronics are Candy, Cindy, Chester, Blank (although he is from the previous generation), and The Penguin. These animatronics are friendly to children, but act creepily to adults, similarly like the animatronics in FNAF2.
Mary fell asleep on the job at a robot factory many months or prior to her job at Candy's. This led to several children being murdered in the robot machine RAT.
The parts that are covered in blood were used to make the new Candy's animatronics. This is also the reason that the puppet points towards them in the cutscenes between nights.
The children who died in the factory have begun haunting Mary for allowing their deaths. The Puppet seems to represent Mary and her guilt, due to the "MY" and "YOUR" being used synonymously.
Some time after the incident, Mary took the job at Candy's, where the events of the game then take place. Mary is hunted by animatronics throughout her week, ending with Mary being fired for tampering with the animatronics during the custom night.
On rare occasion when viewing CAM 03 the posters will change to say "YOU FELL ASLEEP" and "IT IS YOUR FAULT", hinting about Mary falling asleep on the job.