How leverage works in spot transactions on margin
Spot transactions on margin allow you to make spot purchases and sales of cryptocurrencies, on the Kraken exchange, using funds that exceed the balance of your account. Leverage, in this context, determines two things:
  1. 1
    Your used margin following an extension of margin.
  2. 2
    The maximum amount of margin Kraken will extend to you for a spot transaction on margin (your maximum “position size”).
Used margin
Used margin is the amount of your collateral balances that is withheld in order to enter a spot transaction on margin. Used margin is calculated as the size (or "cost basis") of the margin extension provided to you divided by the level of leverage selected.
Let's say you purchase 5,000 USD worth of BTC on the BTC/USD order book using an extension of margin. 
With 5x leverage, only one-fifth of the position size, or 1,000 USD worth, will be withheld from your collateral balance upon purchase of the BTC
With 2x leverage, half of the position size, or 2,500 USD worth, will be withheld from your collateral balance upon purchase of the BTC.
Maximum position size
The possibility of larger profits along with the risk of larger losses (and liquidation) is determined by the size of your open positions relative to your collateral balance and not merely by the level of leverage you select.
When placing a margin trade, position size is selected separately from the leverage level. Selecting 5x leverage does not mean that your position size is automatically 5x bigger. It just means that you can specify a position size up to 5x your collateral balances.
How much leverage should be used?
Assuming the same position size, a higher level of leverage leaves more free margin in the account and thus has a larger buffer from liquidation.
However, if the position size is maximized based on the leverage selected, then a higher leverage level would be more risky.