Interchangeable in meaning — both mean any person at all, and both are singular. Anyone is a little more formal and commoner in writing; anybody is more conversational. The distinction worth knowing is anyone versus any one, two words, which means any single item of a set.
The core difference
None in sense. As with someone/somebody and everyone/everybody, the pair differs only in register: anyone leans formal and written, anybody leans spoken.
Where they appear
Both are commonest in questions, negatives and conditionals, which is where the word any naturally lives:
- Did anyone call? — question
- I did not tell anybody. — negative
- If anyone asks, say nothing. — conditional
In a plain positive statement, anyone shifts meaning to "it does not matter who": "Anyone can learn this" means every person is capable, not that one unspecified person is.
The distinction that matters: any one
Spaced, any one means any single member of a group, and it can refer to things as well as people: "Choose any one of the three." Closed up, anyone refers only to people. If you can insert "single" without breaking the sentence — "any single one of the three" — you want two words.
The grammar
Both take a singular verb — "Is anyone home?" — and both take singular they when referred back to: "If anyone calls, tell them I am out."