The GRE is an umbrella term for various standardized tests tailored for graduate school applicants. Some things to keep in mind:
There are general GRE exams and subject GRE exams. General GRE exams are very similar in format and content to the SAT. If you plan to apply to a mathematics PhD program, you may be required to take the mathematics subject GRE exam.
Whereas there is generally more flexibility with taking the general exam, the subject exam is administered on a limited number of dates and at a limited number of locations. See the ETS website for more details.
There is a current trend to remove the GRE as a requirement; UVa's mathematics faculty officially abolished the requirement in 2023. Check the details of the programs you are interested in.
The mathematics subject GRE is a long multiple choice exam that is timed. It is very difficult to complete it within the allotted time. The score is reported as a percentile, and will therefore depend on the other test takers.
Generally speaking, the GRE has little effect on a committee's evaluation of an application unless the score is very low or very high.
Ask your peers for advice on how to prepare for the GRE.