The first thing that I noticed is that you use while with iterator i instead of normal for loop. Secondly, if you want to use any object outside of the loop you have to declare it before. Are you sure you want to have two separate users for last name and first name? The loop also suggests you want to have multipe users, so you would need an array or list for that.
Here is your code corrected.
public class InputLogic {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
User users[];
System.out.println("How many name you want to enter:");
int num = sc.nextInt();
users = new User[num];
for (int i=0; i<num; i++) {
users[i] = new User();
System.out.println(i + " Enter First name:");
String temp = sc.nextLine();
users[i].setFirst_Name(temp);
System.out.println(i + " Enter Last name:");
temp = sc.nextLine();
users[i].setLast_Name(temp);
}
}
}