What is the subject in 有时间到我家去 There is this sentence in a dialog from my beginner text book:


  好，我走了，有时间到我家去。再见！


I understand the translation:


  Well, I'm going, if you have time, come to my home. Goodbye.


However, though I know all the words, I couldn't understand the sentence before reading the translation. And even now, I'm left puzzled wondering: 你 doesn't appear anywhere in the sentence.

At first, I had translated for myself something like


  Well, I'm going, it's time going home / it's long going back home


(with the 有 referring to 我 as the subject).

What are the elements to guess the 有 is referring to 你 implicitly?

Also, would it be possible to say: 如果有时间 , 到我家去.
Why need subject? It's a imperative. "有时间“ just modifies the sentence as a condition. Comparing with some English sentences:

Well, I'm going. Call me later.
Well, I'm going. Don't forget closing the door.


You don't need subject as well.

For you second question, 

would it be possible to say: 如果有时间 , 到我家去.


It's rare to say like that. Firstly "如果” is unnecessary for short condition. Secondly saying that would sound very formal. The whole sentence itself is not formal. Actually it's not an invitation at all. It just express willing of friendship.

For real invitation, normally he will ask for your availability at first. For example, 下个星期有空吗？到我家去喝茶/吃饭