No, Aloe Vera doesn't help prevent or heal sunburn.

I have to admit to being surprised by this. I was expecting to see a (small) effect.

Porntip Puvabanditsin and Rujirat Vongtongsri, Efficacy of Aloe Vera Cream in Prevention and Treatment of Sunburn and Suntan J Med Assoc Thai 2005; 88(Suppl 4): S173-6.

This experiment involved 20 volunteers in a randomized double-blind trial, where they applied aloe vera cream (or placebo) either before, after or before and after exposure (twice daily for 3 weeks).

The results showed that the aloe vera cream has no sunburn or suntan protection and no efficacy in sunburn treatment when compared to placebo. The aloe vera cream has no bleaching effect too.

Feily, A.; Namazi, M. R., Aloe vera in dermatology: a brief review. Giornale Italiano di Dermatologia e Venereologia 2009 Vol. 144 No. 1 pp. 85-91 ISSN 0026-4741.

This was a review of the scientific literature that came to the same conclusion:

Topical application of A. vera is not an effective prevention for radiation-induced injuries and has no sunburn or suntan protection.

General Burns

However, there is evidence that general (e.g heat-based) burns and wounds can be helped by aloe vera.

The same paper, Feily and Namazi, also states:

It can be effective for genital herpes, psoriasis, human papiloma virus, seborrhoeic dermatitis, aphthous stomatitis, xerosis, lichen planus, frostbite, burn, wound healing and inflammation.

This also concluded that aloe vera helped with burns:

the summary weighted mean difference in healing time of the aloe vera group was 8.79 days shorter than those in the control group

The idea that aloe vera helps with regular burns but not sunburn still surprises me.

Bonus:

Hans B. Juneby, Aloe barbadensis – a legendary medicinal plant Pharmacognosy, 15 hp, 2009

This essay, sometimes straying into superlatives and past what the scientific evidence supports, discusses some of the history of the research, and makes an interesting distinction between fresh aloe vera and the gels found in cosmetics.