Those are just conventions. At first we take the convention that the two kinds of charges observed in the nature, be taken to be positive and negative. Then we take the convention that the test charge that is used for determining the electric field be positive and because likes should repel and unlikes should attract, the field lines should go away from positives and to negatives.