Nobody knows what time is, or how it works. Time seems to be closely related to space, and it's possible that space and time are different ways of looking at the same thing. Some people think that time started with the Big Bang at the start of the universe, and that it will end when the universe collapses, though nobody knows when that will happen, or even if it will happen. If time started with the Big Bang, then that was about 13.7 billion years ago.
One way that time is related to space is that both of them depend on how fast you are moving. If you could travel very fast in a spaceship, close to the speed of light (186,000 miles a second), you would find that both space and time behaved very differently than they do in our ordinary lives. Time would pass much more slowly for you in your spaceship than it would for your sister back on Earth. When you got back, you might find that while you had only gotten one year older, she had gotten seven years older.
These changes in time and space apply even at the slow speeds we can really travel at, but they don't change enough for you to notice. So for practical purposes today, we can treat time and space as if they were the same for everyone. But if we ever learn how to go really fast, close to the speed of light, then we will have to think about space and time very differently.