A residency is a period of training after you complete your internship but before you start vocational training.
During a residency you are employed by a hospital and gain the title of resident medical officer (RMO) of that hospital.
Generally, you will spend two to three years in residency. During this time, you will learn about different medical specialties so you can make an informed decision about which specialty you would like to pursue.
However, you do not have to go on to train in a specialty. You can remain as an RMO indefinitely.