What is the correct usage "Last time/The last time"

Solution 1:

Both are the same (and the sentence should have a comma):

"[The] Last time we went to the shop" is an adverbial clause:

"[The] Last time we went to the shop, we bought eggs = We bought eggs on the last occasion that we went to the shop."

In essence, it does not differ from

"Yesterday, we bought eggs" or "We bought eggs yesterday."