Longest - Joe Louis, 1937-1949, 12 years, 25 defenses. Nobody has come close to even rivaling that record, not at HW, not at any weightclass.
Shortest (at least if we're talking about titles won and lost in the ring): 23 days - tie between Waldemar Holberg and Bob Goodwin