There is one magic tip to prolonging the life of a basil plant: Pinch the flowers as soon as they appear!
Plants such as basil basically just grow till they flower and then stop.
As far as the plant is concerned, it has crossed the finish line and there's nothing left for it to do.
So when you keep taking away leaves for your culinary needs, you're weakening the plant.
On the other hand, by pinching the flowers, what you're doing is effectively pushing the finish line forward, so the plant still runs towards it.
So you'll get new growth every time you pinch them off and your plants will be lush and last longer.
Here is a nice illustration from this site that shows where to trim the flowers to encourage growth.
The article is a good read too!
gardening.stackexchange.com/users/109/Lorem Ipsum
Additional to the other answers, basil famously doesn't like to be damp overnight.
Water mornings, not evenings.
gardening.stackexchange.com/users/99/Tea Drinker
I am attempting to grow Basil for the first time also, but mine seem to be doing pretty well.
From what I found basically they needed a to be planted in soil that will drain well.
In a quick google search I found this site that added a few other things: will not survive indoors susceptible to cold and frost, and to drastic temperature change
gardening.stackexchange.com/users/71/Jacob Schoen
Basil, and herbs in general, do not need to be fertilized.
Consider that basil grew well in Mediterranean geographies in the crags of rocks.
So don't overwater, fertilize, or put it anywhere but in full sun.
Also, @yoda is 100% right, you have to keep on top of pinching the flowers off.
But as a rule of thumb, if it has been a while, never remove more than 1/3 of the foilage at any one time.
gardening.stackexchange.com/users/55/Randy
In the past it has grown almost like a weed in our pots on our deck here in North Texas.
Admittedly we deliberately help it to re-seed itself: we grow it as an annual and winter frosts kill it.
The location is hot (often 100F+) and full sun in the afternoon, but they do take quite a bit of water.
So perhaps shade is the wrong thing?
gardening.stackexchange.com/users/69/winwaed
Some things I've noticed about basil: 1) Basil is deep-rooted.
I have medium size basil plants in fairly large pots (pots which originally contained 5ft pears trees).
The basil roots have grown out of the drain holes and anchored the pots to the ground.
Basil roots can easily exceed 1ft of depth.
2) Basil can root from the stem like tomatoes.
I discovered this while observing a sprout which had a dead spot in the stem which dried to a thread and cut off the root system from the leaves.
Yet, the leaves looked healthy.
It was confounding.
Figuring the leaves must be drawing nutirents from the stem which was touching the ground, I covered the stem with soil and now its a full-size basil plant.
Since this discovery, I hill-up my basil plants like I do tomato and potato plants.
It may be possible to propagate basil by cutting off a stem and sticking it directly into the ground.
Tomato plants will grow this way.
3)
Like tomatoes, basil doesn't care much for an overly acid soil and appreciates a good supply of calcium for strong cell development and magnesium for the abundance of chlorophyll it produces.
My basil responds well to lime, calcium nitrate, magnesium sulfate, and potassium sulfate (calcium, sulfate, magnesium, and potassium are the minerals most leached by rain, in that order).
From The World's Healthiest Foods we can see basil has a "very good" rating next to calcium and iron and a "good" rating next to magnesium and potassium.
The 59mg Ca + 12mg Mg + 96
Mg K must come from somewhere.
Minerals aren't manufactured.
4)
Any suggestion that basil doesn't like water is absolutely false.
We've had record breaking amounts of rain this year.
April, May, and June were 10 inches each
and we had 15 inches for July.
That's a year's worth of rain in 4 months and double or triple the annual rainfall of western or midwestern states.
In spite of all this water, a few days I ago I had to add 1 liter to each plant in repsonse to wilting.
The plants perked up the next day and resumed growing gangbusters.
The basil was the only plant I observed wilting due to lack of water, leading me to believe basil is particularly fond of water.
5)
Basil is salt-sensitive.
Too much KCl can wipe out a stand.
The big bags of 10-10-10 and 13-13-13 are not worth much as fertilzer.
Additionally, there is not a night that passes without my basil being sopping wet...
either from rain, dew, or me spraying with a water hose.
If basil doesn't like to be wet at night, its hard to tell from the overwhelming production of leaves occurring on Genovese, Sweet, and Large-Leaf basil.
If basil doesn't like to grow indoors,
its probably because of a small pot, lack of light, not enough water, and lack of humidity (central air and heat dries the air).
gardening.stackexchange.com/users/2404/Randy
Basil is a great companion plant .
Have a search for 'basil' on
this list of companion plants to see what's good to plant nearby.
gardening.stackexchange.com/users/1767/Daniel
What are the best conditions for basil to grow? I live in the UK and it never seems to last that long. Recently I've been putting the plants in the shade and drenching them in water, which seems to be working so far.
What are the best conditions for basil?
gardening.stackexchange.com
<herbs><basil><optimal-conditions>
gardening.stackexchange.com/questions/81
gardening.stackexchange.com/users/54/Dan
Pinch the flowers as soon as they appear to prolong its life and make sure it has well-drained soil. One tip to prolonging the life of a basil plant is to pnch the flowers as soon as they appear. Basil famously doesn't like to be damp overnight. Basil needs to be planted in soil that will drain well. Basil doesn't care much for an overly acid soil  and appreciates a good supply of calcium for strong cell development and magnesium for the abundance of chlorophyll it produces.  Basil is also a great  companion plant .  
One tip to prolonging the life of a basil plant is to pnch the flowers as soon as they appear. Basil famously doesn't like to be damp overnight. Basil needs to be planted in soil that will drain well. Basil doesn't care much for an overly acid soil  and appreciates a good supply of calcium for strong cell development and magnesium for the abundance of chlorophyll it produces.   Basil is also a great  companion plant .  