Most oftenly I come across this debate of how far an MBBS doctor can treat as accepted by rules, regulations, and law of the land. When can an MBBS doctor be held for unauthorized practice of medicine, surgery and gynaecology & Obstetrics?

As an MBBS general practitioner at what point I will be told that 'this a specialist job and you are not allowed to encroach on it'? Can anybody clear this doubt with proper references?