A HazMat endorsement is valid for:

While a regular CDL is valid for eight years, a HazMat endorsement is valid for only five years after the date the DMV receives notification that your background test has been passed.
DMV Writen Test