Ms Croft, a former chief executive of NHS Grampian, started as chief nursing officer in February following the retirement of Professor Fiona McQueen.
The position will be covered by the team of deputy chief nursing officers until Professor Alex McMahon takes over on an interim basis in October.
Prof McMahon is executive director of nursing and midwifery at NHS Lothian.
Health Secretary Humza Yousaf said: "I would like to thank Amanda for all her hard work as chief nursing officer and I am very sorry to see her leave.
"Since taking up the role she has played a key part in our response to the pandemic, and has brought enormous knowledge and experience to the role.
"I wish her all the best for the future.
"I also welcome Alex McMahon to the role of interim chief nursing officer.
"With his strong professional background I am confident he will bring excellent leadership, and help us to continue our work to get the health service back on track after the challenges of the past year."
Prof McMahon was the Director of Strategic Planning, Performance and Information for NHS Lothian and was Chair of the Scottish Executive Nurse Directors group for four years, working closely with the previous Chief Nursing Officer to shape policy and professional practice.
He qualified as a registered mental health nurse in 1986, and as a registered general nurse in 1989, and has worked in the private sector, NHS and Scottish Government.