Okay lets go through how a five day test match i.e. England vs. Australia might be played out. This is an imaginary example and I'm assuming you've watched the attached vids to get a basic of the game.
How a match unfolds in a five day match .
Day One; Team A bats first and at the end of day one, after three two hour sessions the score is 308 for 7. This means that 308 runs scored and 7 men are out. Team A have lost 7 of their 10 wickets. A days play is 90 overs, weather permitting i.e.,90x 6 balls. If play is lost to rain then that number will fall. However usually up to thirty minutes might be added to the days play to make up for lost time. Or maybe an early start the next day . If no interruption for weather happens 90 overs must be bowled, if the fielding team is slow and hasn't reached 90 at the allotted end of scheduled time, then 30 minutes can be added to finish the overs. A team can be fined for slow over rate.
Day 2; Team A continues its 1st innings and ends up 500 all out, meaning all ten wickets are taken and the innings ends.
There's a eleven a side of course, but 10 outs, you have to bat in pairs.
Team A 500 in 150 overs, so we've used up 60 overs in day 2 , 30 left minus 2 overs allowed for change of innings. So Team B has 28 overs batting to do in day2 . End of day2- Team B 75for 1. Team B are 425 runs behind 9 wickets ( batters) left.
Day 3; Team B bat all day and at the end are 375 for 9, still 125 behind.
Day 4 Team B quickly lose last wicket and end up 398 all out.
Team A starts second innings with a lead of 102, but there's only 2 days left, minus 5 overs that Team B took up finishing their innings. Team A had better score quickly if they want to win. A team wins by obviously bowling the other out twice, 2 innings per match, so Team A scores quickly and with 10 overs left in day 4 have scored 300 for 6 an overall lead of 402. They think they have enough and declare their innings closed. The captain of the batting team , wether he is out in the pitch batting or waiting to come in ,or has already been got out, can signal to the umpires that he is declaring the innings over. Team A has set Team B 403 to win, and with 8 overs left in day4 (10 minus 2 for change of innings) plus 90 on the last day, Team A feels they have enough time to get the other side out while setting them an imposing total to win.
Team B starts second innings and at end of day 4 are 21 for 0 from 8 overs.
Day 5 ; lets go through the three possible scenarios, Team B races to the winning target of 403 and wins, this is very unlikely, 403 can be done in one day limited over cricket, but rarely in 5 day Cricket in just 98 overs because of fielding differences. In 5 day cricket the fielders may take up any position that the Captain wants, he can put all his men crowding the batsman, or most of them could be positioned at the edge of the field stopping fours and sixes , so scoring is much harder.
Scenario 2, Team B is bowled out, they lose all ten wickets for say 224 runs meaning Team A wins by 178 runs.
Scenario 3, at the end of Day 5 team B scores 224 runs for 6 , this means Team B didn't get the runs , and Team A didn't get Team B all out, time has run out. Team B has clung on ..After 5 days ....a draw..Can only happen in Cricket!