The deadline for completing and sending your Self Assessment Tax Return is 31st January following the retrospective Tax year. For example, Tax returns for the year ending 5th April 2020 would be required to be received by HMRC by midnight on 31st January 2021. This is for Self Assessment Tax returns completed online.
For Self-Assessment Tax Returns completed on paper, the deadline is much shorter and ends on the midnight of 31st October following the Tax year. So for example, the deadline for the 2019/20 Tax year would be 31st October 2020, instead of 31st January 2021 for online submission. The reason for the shorter deadline is that HMRC are persuading people to cut down on paper submission that requires to be manually processed (and also subject to being lost in mailing systems). Filing Tax returns online also means that the Tax return is accepted there and then, and the Tax payer is given immediate notice of receipt.
For all Tax returns, the deadline applies to when the Tax return was received by HMRC, not when the Tax return was sent. For example, if a paper Tax return was sent in the post on 31st January, but received on the 2nd February (they stamp all post as it lands with the current day), there will be a late filing penalty of £100 to pay.