OSHA: Occupational Health and Safety Administration
Part of the Department of Labor charged with creating and enforcing laws to ensure worker safety.
NIOSH: National Institute for Safety and Health.
Division of the Center for Disease Control and Prevention. Creates standards for workplace safety, especially in regards to the area of Industrial Hygiene and worker health. This is not an enforcement agency but the standards it creates are usually incorporated by reference into OSHA regulations.
They were created by the same Act in 1970. An overly simplistic explaination would be to say that OSHA is the law making and enforcement arm of the law while NIOSH is the research arm.