What is better recursive or iterative star pattern? I need to do a function getting int and doing star pattern of a square like if I insert 5 into the function it will give me:
*****
*****
*****
*****
*****

I wonder what has a better performance recursive or iterative solution? What is the cost of a recursive solution?

Your Iterative function works better over Recursion  function 
recursive function calls itself for multiple times till false condition not match for recursive calls. 
lets take following example to understand little bit more 
we have to find factorial upto n where n=7 
n=7;
int recfactorial(int n)
{
    if(n > 1)
return n * recfactorial(n - 1);
    else
return 1;
}

for above function n recursive calls so there will be n stacks used. one for each call hence it will be using O(N) auxiliary space.
where as for iterative function 
 for(i=1;i<=N;i++){    
      fact=fact*i;    
  }

you have N mutilipication for loop so your time complexity wll be O(N) . You are going to finish your entire work without extra space required so your programs Auxillary space is constant i.e. O(1)