I hope you understand that there is almost 0 difference in upgrading mobile i5 to mobile i7 since both are 2 cores 4 threads.
As for the RAM question, HP owners manual should list the max supported memory capacity for the laptop.
Usually if it has 2 RAM slots, you'll be limited by 16GB.