The best time of year to visit New Orleans... depends entirely on what you want out of a vacation. Unfortunately, there's not a cut-and-dry answer, but here's hoping this narrows it down for you a bit:
If you want big excitement: go ahead and come visit at Mardi Gras, remembering that the Mardi Gras season, called Carnival, runs for several weeks before the big event, which is usually in Mid-February or early March.
Parades, parties, balls, and general revelry take place from January 6 until Mardi Gras itself. You'll need a slightly higher budget to visit during this time of the year, but if you enjoy the festive, bustling nature of the festival, this is the ideal time.
Also consider: visiting for the French Quarter Festival (early April) or JazzFest (late April-early May). Both of these events draw large crowds for music, food, and fun.
If you're on a budget: consider visiting during the summer. July and August are hot, yes, but hotel deals are abundant and August brings COOL-inary New Orleans, a month of special restaurant deals designed to lure tourists on a budget. Take advantage! You'll find that the heat makes outdoor activities challenging, but there's plenty to do indoors and if you take it slow and drink lots of fluids, you can survive just fine outside, too. We all do!
If you want to avoid giant parties: look at Lent, the seven-week period after Mardi Gras.
The city is exhausted from the weeks of celebrating and many locals keep the holy period as a religious observance. Still, everything's open (restaurants, theaters, plenty of jazz clubs), so there are things to do, eat, and see, but without the potentially overwhelming atmosphere of Mardi Gras.
If you want the best weather: October/November and February/March tend to be the best bets.
The early spring months are particularly nice when you're escaping icy winter conditions up North (plus, they often coincide with Mardi Gras), and the fall months are great for cozy, homey neighborhood street fairs and a touch of holiday festiveness.
My personal favorite: I often encourage family members and friends to visit me over Mardi Gras week -- come a few days before and take in all the revelry and festivities and then stay a few days into Lent to do more sedate activities (museums, for example, or day trips to tour the Tabasco factory or take a swamp tour). The weather tends to be nice and as my people hail from the North, it's a generally-warm escape for them from their never-ending winter. That said, it has been chilly the past few Mardis Gras in a row, so if warm weather is the only goal, there's no guarantee.