She didn't "have to". She chose to.
She didn't actually convert, since she wasn't raised in any particular religious faith. (She did attend a Catholic school but wasn't a Catholic). However, she apparently felt that since she was marrying a royal member of the Church of England and becoming royal, she should join the C of E herself.
But contrary to popular belief, she was not required to do so. Harry could marry a member of any faith, though their children need to be raised C of E, since they will be in line for the throne, and the monarch must be C of E.