They are similar, but "slogan" is normally in an advertising campaign (e.g. "every little helps" for Tesco, or "Life begins here" for Coca-Cola), whereas "motto" is normally the mission or ideals that a group live by. Google apparently has a motto of "don't be evil", which also functions as a slogan, but the motto is more saying the sort of code of conduct they (at least supposedly) try to follow, whereas "slogan" would be them trying to convince people that they are a group which isn't evil.
Overall, "slogan" is more for advertising, whereas "motto" is more just a code of conduct which a group follows.