If I have 20/40 vision does that mean I need glasses?

Depends. This depends on how you value good vision. It is a point where you can often still pass a drivers vision test at the DMV, but the joy of HD vision is lost. Glasses can often improve someone to better than 20/20. The question is somewhat of a personal choice.
No. 20/10 is considered good vision. 20/20 normal. 20/40 a bit worse than normal.