Overstaying means allowing your visa or BRP to expire and staying in the UK. Overstaying is a criminal offence. There is no "grace period" within which you can lawfully overstay.
If you submit a valid application for further leave to remain before your visa or BRP expires then you will not be an overstayer while your application is being decided; instead your previous immigration permission and the conditions attached to it will continue while your application is pending.
If you overstay for more than 28 days you will not be allowed to apply for further leave to remain from within the UK. If you overstay by more than 90 days you will normally be barred from coming back to the UK for at least 12 months.
Although the Immigration Rules allow an overstayer to make a Tier 4 application in the UK (as long as you have not overstayed by more than 28 days), your Tier 4 sponsor may not issue you a CAS in order for you to do so, and/or they may withdraw any unused CAS that you were issued before you became on overstayer. If you are in this situation, get advice from your Tier 4 sponsor about their policy on issuing CAS to overstayers.
If you make a visa application in the UK while you are an overstayer you will continue to be an overstayer while your application is being decided and your Tier 4 sponsor may not allow you to continue your studies. If this is your situation, get specific advice from your sponsor institution about their policy on allowing overstayers to study.
Overstaying will have serious consequences for any future immigrations applications that you make, including applications for countries other than the UK. You must tell the truth in immigration applications and declare any periods of overstay if asked about them. If you are found to have used deception in an immigration application you are likely to be barred from the UK for ten years.
If you need more time in the UK to complete your studies see our information on Making a Tier 4 application for information about submitting a Tier 4 application before your current leave expires.