Some individual cells are long shaped like a needle. Many species of bacteria reproduce by a wall forming across the cell dividing the orginal cell into two daughter cells having the same shape and genetic composition. Some bacteria can divide every 12 to 20 minutes. Suppose that the bacteria in a culture are dividing every 20 minutes on average. Suppose they then hang together for 10 minutes before becoming separated.
Some daughter cells hang together for a long time and form long flexible chains.
In some species, the the cross walls do not pinch of off for a long time and long rigid filaments form. In fact, some genera of bacteria are notable for forming long chains which which to not break apart until the culture runs out of food and is dying. While round bacteria also form chains, some species form squares or cubes. Imagine a single round bacterium which divides and the two cells hang together. Then each of the daughter cells divides in the same plane.