Anne Frank was gifted her diary when she was 13 years old, she recorded her observations and feelings in it until she was 15 years old. Hope this helps!!
I believe the answer is 2 years because she went into hiding for the period of time and kept a record of what was happening around her. She was in hiding for 2 years so I would assume that’s how long she was writing in her diary.