The use of either “anytime” or “any time” depends on the context of formal or informal use. “Any time” is used in formal contexts.
You can check if it should be used as one word if you can substitute it with another adverb. If not, then go with two words.