How long should you be taking nexium (esomeprazole)?

Depends. Some people should be on discrete courses of Nexium, and some people need it long term. It really depends on what the diagnosis is that you are trying to treat. When it is needed, it is OK to take it long term, with medical supervision to watch out for side effects. Good night.
Check with your GI! Your gastroenterologist should determine that. Chronic ppi use has been linked to gastric lymphoma and should only be used when clearly indicated and expertly approved.