Keep pinching flowers from basil when they appear. In areas with a long growing season, you can refresh plants by trimming the tips and fertilizing with a fish emulsion or 20-20-20 diluted according to label directions.
If you let the plant flower, it tells itself, "I've fulfilled my life's purpose by making seed so I can just stop growing." So to continue a nice harvest until cold weather arrives--pinch, pinch, pinch! Put a few sprigs in a small vase to perfume the kitchen. Basil will turn brown at the first sign of frost. Consider making pesto and freezing it for ready access to that fresh basil flavor.
(source: Bonnie's Plants)