The tradition of the Cabinet dates back to the beginnings of the Presidency itself. One of the principal purposes of the Cabinet (drawn from Article II, Section 2 of the Constitution) is to advise the President on any subject he may require relating to the duties of their respective offices. 
- Main page: Bartlet Administration
In the Bartlet Administration, the Cabinet includes the Vice President and the heads of 14 executive departments-the Secretaries of Agriculture, Commerce, Defense, Education, Energy, Health and Human Services, Housing and Urban Development, Interior, Labor, State, Transportation, Treasury, and Veterans Affairs, and the Attorney General.
The Department of Homeland Security was created in 2002 during the George W. Bush Administration, and did not exist in The West Wing.