This article relates to working as self-employed as a sole trader.
When are you self-employed
If you sell your goods or services to others directly, and the payments aren't taxed before they're paid to you (ie you're not paid through payroll on pay-as-you-earn), then you're probably self-employed.
The Gov website has more details on what self-employment looks like.
So what's a sole trader?
A sole trader is a type of self-employed business. If you worked alongside another person, you'd be working as a "partnership", but individually you'd both be self-employed.
What about a Limited Company?
If you have registered a business with Companies House then you won't be operating as a sole trader, but as a "Limited Company".
These are pretty different to working as a sole trader. If you're working this way, technically you're not self-employed (in the eyes of HMRC) as you're an employee of the business that you own, so you don't need to register as self-employed.
This article is focused on sole traders registering for self-employed with HMRC, so that's enough about limited companies for now.
When to register as self-employed
You have until the 5 October following the tax year (which runs from 6 April to 5 April) that you start work in to register as self-employed with HMRC.
So for example, if you start working as self-employed on 1 May 2018, you've got until 5 October 2019 to register. Best to do it sooner rather than later, as you'll have to complete your tax return by 31 January 2020, as well as pay your tax bill - better to get it done early so you can make sure you have the funds to cover it.
How to register as self-employed
You can register as self-employed online. The form you need to fill out will depend on whether you're already registered to complete an annual self-assessment (for example if you've had to register for other reason like making investments or because you're a landlord).
You can find the links to both forms on this page of the Gov website.
If you've not done a self-assessment before, you'll need to wait for a code to arrive in the post, so make sure you leave plenty of time to register.