You may want to wait a bit before checking out Phil Roth's wonderful little tool that allows you to explore baseball teams' payrolls, because you'll be there a while.
The salary data comes from Baseball Reference, which primarily gets its information from the usually reliable Cot's Baseball Contracts. Roth explains everything on his page, but it's easy to dive right in and begin playing around. It breaks down team payrolls for each year, and within that, individual player contracts for each team.
Even better, it goes all the way back to 1998 and all the way forward through 2023. Feel the Albert Pujols buyer's remorse, in bar graph form!
MLB Past and Future Payrolls [MrPhilRoth]