Poker is equal parts skill and luck. The skill is in recognizing betting patterns and knowing the math, and strategy of position and stack size on any given hand.
But there's always an element of luck. A 7 and 9 off suit in the hole can and will beat your opponents bullets all-in preflop often enough, and the reverse will happen too.
Skill and math and experience will only increase your odds of making money over time. While each hand contributes to your results over time, never assume that you'll beat the variance on any single hand.