You can apply your Pell Grant award to tuition at the school you are enrolled in as long as that school is accredited and approved to accept federal student aid. Roughly 5,400 universities and colleges, including some online schools, accept Pell Grant money. You can use the Pell Grant toward any online classes you take in addition to physical classes at any accredited university.
The vast majority of physical universities and colleges in the U.S. accept Pell Grant money. If you attend a physical college as an enrolled student pursuing a degree and your college also offers online classes, you can enroll in an online class and pay for the class with your federal award.
Some well-established and accredited online schools, such as the University of Phoenix, can be paid for with Pell Grant money. However, many online schools do not have credentials recognized by the Department of Education. If the Department of Education does not recognize an online university as a legitimate school, you cannot use Pell Grant money to pay for tuition.
You cannot use Pell Grant money to pay for an online course that does not count toward your bachelor's degree or an online course offered by an entity other than the university at which you are enrolled.
Depending on how your school's financial aid office administers Pell Grants, you may or may not be able to apply grant money directly to online classes. The federal government sends Pell Grant money to schools, which then either apply the money directly to the student's tuition balance or cut the student a check. If the school gives you a check, you can decide how to allocate the money.