Studying in the USA does not by itself give you a green card. A student visa is temporary. It lets you study, not settle.
Still, many students move toward permanent residence step by step. The most common path is work-based. After graduation, you can use Optional Practical Training to work for up to 12 months, or longer for qualifying STEM degrees. An employer can then sponsor you for an H-1B work visa, and later for a green card through an employment category.
Family sponsorship is another route. If you have a close relative who is a US citizen or permanent resident, they may be able to petition for you. Waiting times vary a lot by category and country.
The Diversity Visa program offers a limited number of green cards each year to people from countries with low immigration rates to the USA. It is a lottery, not something you can plan on.
Investment-based green cards also exist, but they require a very large investment and strict job-creation rules.
None of these paths is quick or guaranteed. Plan for several years, keep your visa status legal at every step, and talk to an immigration lawyer before you count on any one route.
Related reading: Can I get US citizenship if I study in the USA?, International Student Admission Requirements, and International Student Support Services.

