I saw both of them in websites. But in my IELTS exam they have written 'photo card' as the answer. I couldn't find it in Oxford and Longman dictionaries. It was 'photocard' in Collins dictionary. So which one is correct and is there any difference?
It is a difficult question.
Words that start out as separate will sometimes get combined. This is a question of use and how common the combined form becomes. One way this happens is when new technology comes into existence, or new methods of using old technology arise. For example, cell phone (two words) becomes cellphone (one word).
The combined form photocard is certainly in use around the net. It usually means a "photo identification card" or something similar. For example, a company ID or security badge with a photo on it, etc. So, when it is a thing like that, photocard would be correct. (Despite the spell checker here rejecting it.)