These websites, often known as ‘diploma mills’, offer a variety of diplomas based on some sort of online test or statement of life skills. The mills seem to offer a free testing service but then make money by charging applicants for administration fees to provide the actual certificate.
A real high school diploma shows that the recipient has reached a certain level of education and this needs to be independently verified by ensuring the graduate is the actual person who took the tests. Certificates bought over the internet can be completed by anybody so the US Department of Education does not recognize these types of instant diploma.
If you did not finish high school you could consider studying for a General Education Development (GED) diploma. This is a qualification in math, literature, science and arts for those who did not graduate from high school and is recognized in the USA and Canada.
GED training can be available for free from local community college but you must take a test in an approved GED testing center. You cannot get this qualification via a website and it will take some time to achieve, depending on how much studying you need to do to gain sufficient knowledge to pass the tests.
If you did graduate and just need to get a copy of your diploma, you need to apply for a diploma reissue from the department of education in the state you graduated. Depending on which state, there may be a small administration charge for the duplicate and this will usually take several weeks to come through.