When I am sending a mail from my one mail account (Yahoo) to other (Gmail), Gmail automatically puts my mails into the Spam folder. What is the basic criteria to send an email by which mail servers cannot treat my mail as a spam?
While the list of criteria used by GMail's spam filter is a trade secret, most spam filters are quite similar.
The list of spam criteria used by a very popular Spam Assassin spam filter is made public, together with weights.
Some of the most important ones, cherry-picked by me:
And so on.
There are some services that allow you to test your message for compliance with the spam filters and see what exactly is wrong with it — http://spamcheck.sitesell.com/ is one of them.
So Gmail has a learning system that is part based on all users and part based on a single user.
This is on top of the standard spam checks @apostlion described.
Easy answer is not to send spam, or things that users may consider spam.