On Android, tap the Menu button on the top left-hand side of your app. Go to Settings > scroll all the way down > Log Out.
On iOS, tap the My Music icon in the bottom right-hand corner > Settings wheel in the top left-hand corner > scroll all the way down > Log Out.
*Please note that logging out will clear your listening history.