How to know when you are writing or in the textfield?

I'm trying to know a way to get when the person is on the textfield so like that you can have a var stop(bool) that its false and when person clicks on the textfield stop is equal to true and when it finish writing the variable is equal to false.

Have a look at GUI.GetNameOfFocusedControl() and GUI.SetNextControlName() in the documentation. That should point you in the right direction.