Yes, each team plays 162 games. There are 30 Major League baseball teams. 16 are in the National League and 14 are in the American League. The difference between the National and American Leagues is the use of the Designated Hitter (DH). The American League uses a DH to bat in place of the pitcher while in the National League the pitcher has to bat for himself. Personally I like the National League version better. Makes strategy come into play on whether to let you pitcher bat or take him out for a pinch hitter. Major League pitchers usually are not very good hitters as they spend most of their time becoming better pitchers and they don't play every day, hence less opportunity to hone their craft as a hitter.
Each League is split into three divisions, East, West, and Central. Overall record is what determines the division winners. Division winners make the playoffs as well as one "wild card" team from each league (National and American). A wild card team is the "best of the rest" from an overall record perspective.
Yes there are regular season games between the leagues called "interleague" games although there are not very many. Most games are played within the respective leagues. Division games are very important because they afford you the greatest opportunity to make up ground or extend leads within your division however all games are important since overall record determines division winners, playoff spots, and playoff seedings.
Interesting thing about interleague games is that where the game is played determines whether the DH can be used. If played in an American League home park such as Yankee Stadium both teams can, and will use a DH. If played in a National League home park such as Atlanta the DH cannot be used. The pitcher must bat when his spot comes up. If someone else bats for him as a pinch hitter, then the pitcher must leave the game and cannot return.
As to why there is 162 games I am sure that is for money. The more games there are, the more money that is made in tickets, TV, concessions, etc.