In many US high schools, students take AP Language as juniors and AP Literature as seniors. Other high schools offer both only to seniors, so you are forced to choose.
In any case, both are difficult tests to get 5’s on; less than 10% of test-takers for both get 5’s (although they are two of the most popular AP tests, so take that into account!).
They share very similar formats; around 55 multiple choice questions followed by three essay questions. AP Language gives you 15 minutes to read a passage before the essay section, while AP Literature does not give you that time.
The classes themselves are different, though. AP Language is broader, focusing on understanding arguments (what they are, how to make them powerfully, etc.) in non-fiction. You’ll do lots of argumentative writing, among other things.
In AP Literature, you’ll read novels and poetry almost exclusively, writing analytical essays, which are substantively different from argumentative essays in that in analytical essays, you’ll use properties of the literature (tone, imagery, characterization, etc.) to understand broader themes, whereas in argumentative essays, you’ll use similar properties to understand the effectiveness of an author’s argument. AP Literature is a much deeper dive into novels and poetry, but AP Language has a fair share of reading to, so don’t underestimate it.
When it comes to the classes (not the tests), you’ll do more reading in AP Lit, but probably more writing in AP Lang. The skill-building in AP Lang is probably more useful outside of school than the skill-building in AP Lit as well. That pretty much covers it. I took both tests and enjoyed both classes, but I ultimately felt AP Lit was the harder class for me because of the amount of reading required. I also love writing, so that biased me in favor of AP Lang.