I would consider 40 miles RT to be a very long commute. My commute is 32 miles RT and I wouldn't want to ride any farther. The main issue is the time rather than the distance. My commute ends up taking about 2:30 hours a day including time spent getting dressed, sitting at traffic lights, etc. My wife would be very upset if my commute took even more time. I occasionally ride the long way home, which extends my RT commute to 45 miles, but only on days when my wife is not home or otherwise engaged -- because I don't get home until after 7 pm.
The other big issue with long commutes is the weather. The longer the commute, the more likely to you are to have to deal with difficult weather conditions -- such as excessive heat, thunderstorms, ice, etc. I sometimes have to leave work late to avoid storms or catch a ride home with a coworker.