Albert Einstein is credited with developing the theory of relativity, which comprises two main parts: special relativity (1905) and general relativity (1915). These theories revolutionized our understanding of space, time, gravity, and the universe.