The AP Music theory test consists of a lot of different concepts including :
- being able to read all clefs (including alto, tenor, etc.)
- knowledge of musical terminology (there is a lot covered on the test)
- knowledge of keys, scales and modes
- knowledge of basics about the instruments like what they sound like
- basic chord construction
- basic voice leading concepts
- Roman numeral analysis, form and analysis, figured bass
- transcription of a melody
- sight singing
Pretty much everything you would go over in an intro college level music theory/ ear training class. Taking lessons from someone who teaches music theory would be very helpful along with getting a good theory book and drilling all the concepts.
The test itself is broken into two sections which are a multiple choice section and a free response section. Each section is further split into an aural section where you need to listen to something and respond, or in the case of the sight singing create sounds based on what is given, and a concept section where your basic theory knowledge and concepts are tested.
Here is the PDF of the College Board Music Theory Course Description, with a full explanation of what the test covers, and sample questions.
In terms of preparing, there is a practice test on the College Board web site, and it says you can "talk to your counselor" about taking the AP Music Theory course online from an "approved provider" if your school does not offer it. You should also do a web search for something like "AP music theory practice questions". There are plenty of sample and prep questions peppered around the Internet.