Strength adds to your Attack, it increases the base attack; the damage you can do without an added weapon. (255 Attack + Cypress Stick = Pwnage)
Vitality adds to your defense, it increases the base defense, How much damage you receive without any added armor. (255 + Clothes = Pwnage) It also increases your Hit Point value as you increase in levels. The higher your Vitality stat, the less damage you will take from physical attacks and the higher your Hit Point Value will increase at "Level Up". Example; A Level 1 thief with a Vitality stat of 14+ with an appropriate personality, upon level up could see an increase of up to 40+ Hit Points.
Intelligence adds to your defense against the damage of Magical Attacks. It also increases your Magic Point value as you increase in levels. The higher your Intelligence Stat, the less damage you will take from magical attacks and the higher your Magic Point Value will increase at "Level Up". Example; A Level 1 Cleric with an Intelligence stat of 16+ with an appropriate personality, upon level up could increase up to 40+ Magic Points.
Agility determines the order in which character takes an action, (Equipment doesn't qualify). The Character with the highest Agility stat, will generally take action first, unless an enemy unit is given a higher Agility Value. If attempting to flee, it is always a good idea to make the character with the highest Agility stat attempt to flee- If no enemy unit has a higher Agility Value, then the attempt can be successful.
Luck determines the ratio of which a "Critical Hit," it also determines how successful a status ailment will be with connecting to it's target, both cast from an ally and an enemy unit. Example: The Hero casts Sleep against a Kandar Henchman with a Luck Value of 33. If the enemy unit's Luck is above 33, then the Kandar Henchman will not fall asleep. if the Enemy unit's Luck Value is below 33, then the difference in Value is figured into a set equation that is used to determine if the status ailment connects.
With the last example, the program uses a variation of the "Random Number Generator," present within the game's limited code. When the Enemy unit's Luck Value is lower then the Character's, the program initiates the equation to determine the results. Because the player is unable to see the Luck Value of the enemy unit, it implies "Randomness" when it is already predetermined. Each Status Ailment spell, has a separate equation, as does a regular attack (which also has a separate set of equations involving Vitality and Agility Values), and each Magical Spell- (Both Offensive and Defensive).
Based on the equation, using the variables of a generated Enemy Luck Value, and the Hero's Luck Value- it is determined whether or not the Spell is successful as I said. This is not a guarantee either, because there is a chance that the enemy has a higher Speed Value, (Not always more than the Hero) then the variable generated for the equation.
I hope I made it more clearer what your stats do. It can be quite confusing. Especially without knowing the game mechanics or how the "Random Number Generator" works.