IELTS is not mandatory. For visa or citizenship applications for the UK, you might be required to prove a knowledge of the English language by passing a secure English language test [SELT]. There are 2 different types of tests as different UK immigration routes involve a different level of English language ability.
The level of test needed – referred to as the Common European Framework of Reference for Languages [CEFR] – will be as per the immigration route applying for.